php 在linux 用file_exists() 函数判断 另外一台服务器映射过来的文件是否存在 总是返回false 。如下案例 $type="android";
$url="/opt/mobile_system/gscdn"; $file_name="update.ini";
#映射目录的
$path=$url.'/'.$type.'/'.$file_name;
if(file_exists($path)){ //判断文件是否存在 echo "存在"; }else{ echo "不存在"; } 虽然目录是存在的,但是用这个函数返回的还是的false. 所以的使用 $arr_=scandir("/opt/mobile_system/gscdn");$arr_这样得到是一个数组。 则,可以用以下的判断 if(count($arr_)){ echo "存在"; }else{ echo "不存在"; }
转载于:https://www.cnblogs.com/hgj123/p/4500346.html
相关资源:PHP中file_exists使用中遇到的问题小结