/**
* Notes:判断文件是否存在(远程和本地文件)
* @param $file string 完整的文件链接
* @return bool
*/
function check_file_exists($file)
{
//远程文件
if ('http' == strtolower(substr($file, 0, 4))) {
$header = get_headers($file, true);
return isset($header[0]) && (strpos($header[0], '200') || strpos($header[0], '304'));
} else {
return file_exists($file);
}
}
11-06
1241
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountBlack.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交