PHP判断网络文件是否存在
- 作者: 我叫尚春晚
- 来源: 51数据库
- 2022-08-24
[PHP]代码
$file = "http://www.xxx.nxxxet/demo/file_exists.zip";
$fileExists = @file_get_contents($file,null,null,-1,1) ? true : false ;
if($fileExists){
echo "File Exists!";
}else{
echo "Sorry, we couldn't find the file.";
}
推荐阅读
