I am using the following code:
function GetTwitterAvatar($username){
$xml = simplexml_load_file(\"http://twitter.com/users/\".$username.\".xml\");
$imgurl =
I've found a nice example in the php documentation.
So the code is:
libxml_use_internal_errors(true);
$sxe = simplexml_load_string(" ");
if (false === $sxe) {
echo "Failed loading XML\n";
foreach(libxml_get_errors() as $error) {
echo "\t", $error->message;
}
}
And the output, as we/I expected:
Failed loading XML
Blank needed here parsing XML declaration: '?>' expected Opening and ending tag mismatch: xml line 1 and broken Premature end of data in tag broken line 1