首页  >  文章  >  php教程  >  PHP判断网络文件是否存在

PHP判断网络文件是否存在

大家讲道理
大家讲道理原创
2016-11-08 14:42:06910浏览

<?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&#39;t find the file.";
}
?>


声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn