Jump to content

simplexml-load-file check stream


residual

Recommended Posts

Is there a way to check if a xml stream is up and working prior to calling the simplexml-load-file function?

 

For instance. I call this stream: simplexml_load_file(http://duncanmackenzie.net/services/GetXboxInfo.aspx?GamerTag=ocr%20envy) which works 80% of the time, however if the stream is offline it returns "Service Unavailable". The simplexml function spits out an error and does not continue the script.

 

Warning: simplexml_load_file(http://duncanmackenzie.net/services/GetXboxInfo.aspx?GamerTag=ocr%20envy) [function.simplexml-load-file]: failed to open stream: HTTP request failed! HTTP/1.1 503

Link to comment
https://forums.phpfreaks.com/topic/156423-simplexml-load-file-check-stream/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.