Tumbrl API를 사용하여 내 홈페이지에 몇 개의 게시물을로드하고 있습니다.simplexml_load_file에 대한 오류 검사를 수행하는 방법은 무엇입니까?
이$xml = simplexml_load_file($request_url);
때때로이로드 내가 대신이 출력을 얻을 미세하지만 다른 시간 :
Warning: simplexml_load_file(http://mysite.tumblr.com/api/read?type=post&start=0&num=10&type=photo) [function.simplexml-load-file]: failed to open stream: HTTP request failed! HTTP/1.1 503 Service Temporarily Unavailable in mysite.com/html/index.php on line 624
Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "http://mysite.tumblr.com/api/read?type=post&start=0&num=10&type=photo" in mysite.com/html/index.php on line 624
가 에러 체크의 어떤 종류 페이지에서 경고를 표시하지 않도록 구현해야을 나는 다음 호출을 ?
"@"기호는 여기에 나를 위해 그것을했다! 감사!!! – anna
그게 나를 위해 일했습니다. 감사! –
오류 메시지를 처리하기 위해'@'기호를 사용하는 ** NOT **에 대한 환상적인 설명. 'file_exists ($ file)'는 완벽하게 작동합니다. 감사. –