日期:2014-05-17  浏览次数:20449 次

file_exists一直不存在
用is_file也不存在

$path = "http://localhost/IMAGES_951234567/1372.jpg";
if(is_file($path)){
echo "存在";
}else{
echo "不存在";
}
一直显示不存在
我在浏览器上打这个地址,图片就出来了
另外说一下,我伪静态了地址






肿么办~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

------解决方案--------------------
file_exists 和 is_file 应该是不能用于url文件
如果仅仅是检测图片是否存在,则可以这样写:
 $url=@getimagesize($path);

if(!is_array($url))
{
     echo ' The image doesn\'t exist';
}
else {
     echo ' The image exists';
}

检查所有类型文件的话可以用curl