仅在不超过2天的情况下卷曲下载图像
我想从远程服务器下载图像,只要它不超过两天。
我正在运行的代码是否正确?我想在下载之前知道
last_modified
数据。
$ch = curl_init($file_source); // the file we are downloading
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_FILE, $wh);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_FILETIME, true);
curl_exec($ch);
$headers = curl_getinfo($ch);
$last_modified = $headers['filetime'];
if ($last_modified != -1) { // unknown
echo date("Y-m-d", $last_modified); //etc
}
curl_close($ch);
fclose($wh);
没有找到相关结果
已邀请:
1 个回复
坛沤疲撑拆