如何获取缓存控制:PHP中cURL的max-age值?
我有:
$this->get_headers_from_curl_response(curl_exec($this->curl));
cURL是否有一个仅返回max-age
值的参数?
答案 0 :(得分:1)
使它非常简单(未经测试,但应该有效):
$headers = $this->get_headers_from_curl_response(curl_exec($this->curl));
$headers = explode("max-age=", $headers);
$headers = explode("\n", $headers[1]);
$max_age = trim($headers[0]);