Php XML提要503错误
当我从XML流中收到503错误时,是否可能不让它停止PHP脚本,而是重试?您的问题可以从更多上下文中受益,但假设您指的是HTTP状态代码503,您可以尝试使用它Php XML提要503错误,php,xml,timeout,Php,Xml,Timeout,当我从XML流中收到503错误时,是否可能不让它停止PHP脚本,而是重试?您的问题可以从更多上下文中受益,但假设您指的是HTTP状态代码503,您可以尝试使用它 do { $feed = simplexml_load_file('http://example.com/rss.xml'); } while (strpos($http_response_header[0], '503') !== false); // do something with $feed now 只要服务器的状
do {
$feed = simplexml_load_file('http://example.com/rss.xml');
} while (strpos($http_response_header[0], '503') !== false);
// do something with $feed now
只要服务器的状态代码为503,就会重复此操作。您的问题可以从更多上下文中受益,但假设您指的是HTTP状态代码503,您可以尝试使用
do {
$feed = simplexml_load_file('http://example.com/rss.xml');
} while (strpos($http_response_header[0], '503') !== false);
// do something with $feed now
只要服务器具有503状态代码,就会重复此操作