SimpleXML parse external php feed

kadencayden

New Member
I want to parse an external php feed.The address: http://www.hittadjur.se/feed.php?count=1The output:\[code\]<?xml version="1.0"?><annons><rubrik>Wilja</rubrik><datum>2013-03-22</datum><ras>Chihuahua l?ngh?r</ras><ort>G?teborg</ort><bildurl>http://www.hittadjur.se/images/uploaded/thumbs/1363984467.jpg</bildurl><addurl>http://www.hittadjur.se/index.php?page=case&type=&county=32&subpage=show&case=1363984558</addurl></annons>\[/code\]My PHP code that doesn't work:\[code\]$content = utf8_encode(file_get_contents('http://www.hittadjur.se/feed.php?count=1'));$xml = simplexml_load_file($content);echo $xml->annons->rubrik;\[/code\]The reason I use the \[code\]utf8_encode\[/code\] is that I receive this message if I don't:\[code\]parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xE5 0x6E 0x67 0x68\[/code\] The error now is:\[code\]Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity\[/code\]Any ideas?Thanks!
 
Back
Top