Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我从 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
只要服务器以 503 状态代码响应,这将重复该do块。
do