php判断远程文件是否存在
//判断远程文件是否存在function remote_file_exists($url) {
$executeTime = ini_get('max_execution_time');
ini_set('max_execution_time', 0);
$headers = @get_headers($url);
ini_set('max_execution_time', $executeTime);
if ($headers) {
$head = explode(' ', $headers);
if ( !empty($head) && intval($head) < 400) return true;
}
return false;
}
神奇的iteye,居然有两个empty,无语了.
页:
[1]