Monday, April 19, 2010

alexa count using php

if (!$myxml=simplexml_load_file('http://www.alexa.com/xml/dad?url=thuriam.com')){

echo 'Error reading the XML file';

}
echo "
";

//print_r($myxml);
//echo "
";
// print_r($myxml->RLS->RL);
/*echo $count=count($myxml->RLS->RL);
echo "
";
for($i=0;$i<$count;$i++)
{
foreach($myxml->RLS->RL[$i]->attributes() as $a => $b){

echo "
";

//print_r($rls);
echo "
";
echo $a,'="',$b,"\"
";
echo "
";


}
}*/
echo $scount=count($myxml->SD);
echo "
";

//print_r($myxml->SD);
echo "
";
echo "
";
for($i=0;$i<5;$i++)
{
foreach($myxml->SD[$i]->attributes() as $a => $b){

echo "
";

//print_r($rls);
echo "
";
echo $a,'="',$b,"\"
";
echo "
";


}
}

?>

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home