/** * 获取远程文件的最后修改日期 * $file 完整路径 * $ver 最后修改时间(时间戳) */ function remote_file_ctime($file){ //清除缓存并再次检查文件 clearstatcache(); $headInf = get_headers($file,1); if(isset($headInf['Last-Modified'])){ $ver = strtotime($headInf['Last-Modified']); return $ver; } //404 Not Found return false; }