$url ='http://data.alexa.com/data/?cli=10&dat=snba&ver=7.0&url='.$q;
$xml = simplexml_load_file($url);
//echo $xml;
$SD=$xml->SD;
//print_r($SD);
$rank = number_format($SD[1]->POPULARITY['TEXT']);
$rankdelta = number_format($SD[1]->RANK['DELTA']);
//$url = 'http://data.alexa.com/data/?cli=10&dat=snba&ver=7.0&url='.$q;
// $xml = simplexml_load_file($url);
// $SD=$xml->SD;
// $rank = number_format($SD->POPULARITY['TEXT']);
// $rankdelta = number_format($SD->RANK['DELTA']);
$reachrank = number_format($SD->REACH['RANK']);
$title = $SD->TITLE['TEXT'];
$linksin = $SD->LINKSIN['NUM'];
$owner = $SD->OWNER['NAME'];
$email = $SD->EMAIL['ADDR'];
$phonenumber = $SD->PHONE['NUMBER'];
$createddate = $SD->CREATED['DATE'];
$speedtext = number_format($SD->SPEED['TEXT']);
$speedpct = number_format($SD->SPEED['PCT']);
$langlex = $SD->LANG['LEX'];
$langcode = $SD->LANG['CODE'];
$street = $SD->ADDR['COUNTRY'].' '.$SD->ADDR['STATE'].' '.$SD->ADDR['CITY'].' '.$SD->ADDR['STREET'].' '.$SD->ADDR['CITY'];
$sitedesc = $xml->DMOZ->SITE['DESC'];
$cat = $xml->DMOZ->SITE->CATS->CAT['ID'];?>