Hi everyone,
Having a few problems parsing an XML file using SimpleXML.
PHP Code:
$xmlstr = simplexml_load_file('http://feeds.feedburner.com/BloggerFCO');
The above code results in the following errors:
Code:
Warning: simplexml_load_file() [function.simplexml-load-file]: http://feeds.feedburner.com/BloggerFCO:1: parser error : Document is empty in /home/civicsur/public_html/local/task/test/feedtest.php on line 3
Warning: simplexml_load_file() [function.simplexml-load-file]: in /home/civicsur/public_html/local/task/test/feedtest.php on line 3
Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in /home/civicsur/public_html/local/task/test/feedtest.php on line 3
Warning: simplexml_load_file() [function.simplexml-load-file]: http://feeds.feedburner.com/BloggerFCO:1: parser error : Start tag expected, '<' not found in /home/civicsur/public_html/local/task/test/feedtest.php on line 3
Warning: simplexml_load_file() [function.simplexml-load-file]: in /home/civicsur/public_html/local/task/test/feedtest.php on line 3
Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in /home/civicsur/public_html/local/task/test/feedtest.php on line 3
Strangely, when I use the following code, it works fine:
PHP Code:
$xml = file_get_contents('http://feeds.feedburner.com/BloggerFCO');
$xmlstr = simplexml_load_string($xml);
Anyone know what's going wrong here?
Edit: Should have added that the first code snippet I posted works fine for other XML files, just not the one in question
Thanks!
Bookmarks