I am using the following code:
function GetTwitterAvatar($username){
$xml = simplexml_load_file(\"http://twitter.com/users/\".$username.\".xml\");
$imgurl =
If you look at the manual, there is an options parameter:
SimpleXMLElement simplexml_load_file ( string $filename [, string $class_name = "SimpleXMLElement" [, int $options = 0 [, string $ns = "" [, bool $is_prefix = false ]]]] )
Options list is available: http://www.php.net/manual/en/libxml.constants.php
This is the correct way to suppress warnings parsing warnings:
$xml = simplexml_load_file('file.xml', 'SimpleXMLElement', LIBXML_NOWARNING);