I'm trying to read the contents of an external xml feed. When I view the link in the browser it renders the xml contents as it should, but when I run it in my browser I get errors. My code is as follows:
<?php
$url = "http://www.thebigchoice.com/feeds/job_xml.php";
$xml = simplexml_load_file($url);
print_r($xml);
?>
Here is the error that I'm getting:
( ! ) Warning: simplexml_load_file() [function.simplexml-load-file]: http://www.thebigchoice.com/feeds/job_xml.php:1: parser error : Start tag expected, '<' not found in C:\wamp2\www\phpAcademy\TheBigChoice\TMPr785mziagz.php on line 14
Call Stack
# Time Memory Function Location
1 0.0004 365880 {main}( ) ..\TMPr785mziagz.php:0
2 0.0004 366048 simplexml_load_file ( ) ..\TMPr785mziagz.php:14
( ! ) Warning: simplexml_load_file() [function.simplexml-load-file]: Unknown type: [8] Undefined index: HTTP_USER_AGENT<br /> in C:\wamp2\www\phpAcademy\TheBigChoice\TMPr785mziagz.php on line 14
Call Stack
# Time Memory Function Location
1 0.0004 365880 {main}( ) ..\TMPr785mziagz.php:0
2 0.0004 366048 simplexml_load_file ( ) ..\TMPr785mziagz.php:14
( ! ) Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in C:\wamp2\www\phpAcademy\TheBigChoice\TMPr785mziagz.php on line 14
Call Stack
# Time Memory Function Location
1 0.0004 365880 {main}( ) ..\TMPr785mziagz.php:0
2 0.0004 366048 simplexml_load_file ( )