Jump to content

PHP w/XML n00b. Fatal Error loading XML


ins0mniac_74

Recommended Posts

With the following code I am getting the Fatal Error: Maximum Execution time of 30 seconds exceeded.

 

$weather_data = simplexml_load_file('ftp://ftp2.bom.gov.au/anon/gen/fwo/IDV10450.xml');
$issuedate_pre = $weather_data->xpath('amoc/issue-time-utc');
echo $issuedate_pre."\n";
$issuedate_post = DateTime::createFromFormat('Y-m-d?H:i:s?', $issuedate_pre);
echo $issuedate_post."\n";
$issuedate_unix = $issuedate_post->format('U');
echo $issuedate_unix;

 

The page reads that "Line 10" is to blame for this, that is the first line in that script.

I would have thought it might happen if the server doesn't respond, but if you go to the source of the XML it will load in a few seconds.

 

Any help on how to load the XML properly would be greatly appreciated.

 

Regards.

Link to comment
https://forums.phpfreaks.com/topic/222794-php-wxml-n00b-fatal-error-loading-xml/
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.