PHP判断网络文件是否存在

原创
2016-07-25 08:42:10 925浏览

[PHP]代码

  1. $file = "http://www.xxx.nxxxet/demo/file_exists.zip";
  2. $fileExists = @file_get_contents($file,null,null,-1,1) ? true : false ;
  3. if($fileExists){
  4. echo "File Exists!";
  5. }else{
  6. echo "Sorry, we couldn't find the file.";
  7. }
复制代码
是否存在, PHP


声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。
上一条:php curl 添加cookie伪造登陆抓取数据 下一条:php curl 上传文件

相关文章

查看更多