2009-11-30 58 views

回答

15

是的,但你必须通过解析响应和寻找的东西,看起来像做自己:

<meta http-equiv="refresh" content="5;url=http://example.com/" /> 

服从<meta>刷新请求是一个浏览器端的事情。使用DOM解析在响应cURL为您提供的适当属性中寻找<meta>标签。

如果你能保证响应是有效的XML,你可以做这样的事情:

$xml = simplexml_load_file($cURLResponse); 
$result = $xml->xpath("//meta[@http-equiv='refresh']"); 
// Process the $result element to get the relevant bit out of the content attribute