Problems parsing lookup.xml with @simplexml_load_file()


All was fine until a time ago… I cannot parse with the @simplexml_load_file() PHP… any suggestion… would be apreciated… thanks.


here is my code:

$url = “{$name}”;

if (@simplexml_load_file($url))
$xml = simplexml_load_file($url);
$id = $xml->user->id;
$av = $xml->user->profile_image_url;


Have you tried any debugging or error handling around this? What’s the actual API response you’re getting?


result: runtime error time: 0.02s

<?php $url = ""; if (@simplexml_load_file($url)) { $xml = simplexml_load_file($url); $id = $xml->user->id; $av = $xml->user->profile_image_url; } echo $id; ?>


Just runtime error


There’s a lot more you can try to debug through this. Try working outside of your programming language and making this request on the command line using a tool like curl. Consider using a more robust XML parser in PHP. Consider making the API request with a full featured HTTP library instead of simplexmlLoad_file…


Can any one tell me what are the applicable arguments that we can pass in simplexml_load_file using php