Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/280.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
CURLINFO_FILETIME忽略通过PHP创建的图像_Php_Curl - Fatal编程技术网

CURLINFO_FILETIME忽略通过PHP创建的图像

CURLINFO_FILETIME忽略通过PHP创建的图像,php,curl,Php,Curl,使用CURL验证最近时间的图像更改的各个URL地址。对于图片,它一直工作到我点击 如何控制我通过PHP脚本创建的这些图像? $image_url = "http://www.medard-online.cz/scripts/getimage.php?initDate=140526_00&domain=2&variable=cloud&offset=3"; $curl = curl_init($image_url); curl_setopt($curl, CURLOPT_

使用CURL验证最近时间的图像更改的各个URL地址。对于图片,它一直工作到我点击

如何控制我通过PHP脚本创建的这些图像?

$image_url = "http://www.medard-online.cz/scripts/getimage.php?initDate=140526_00&domain=2&variable=cloud&offset=3";

$curl = curl_init($image_url);
curl_setopt($curl, CURLOPT_NOBODY, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FILETIME, true);
$result = curl_exec($curl);

 if ($result === false) {
    die (curl_error($curl)); 
 }

$timestamp = curl_getinfo($curl, CURLINFO_FILETIME);
CURLOPT_FILETIME“尝试检索远程文档的修改日期”(引用:PHP手册)

为了实现这一点,“远程文档”必须首先通过
LAST-MODIFIED
标题传递该信息。通常这是由web服务器本身为静态文件完成的,但是当您通过自己的脚本输出数据时,您也必须自己完成。(假设提供图像的脚本确实是您自己的——如果不是,您只能要求提供图像访问权限的一方为您实现这一点。)