2010-03-02 50 views

回答

0

說明:http://s.site90.com/api-xml.php

phpcode:

<? 
$ip = $_SERVER["REMOTE_ADDR"];// or ex. "92.32.207.124" 
$data = simplexml_load_string(file_get_contents("http://s.site90.com/api/xml.php?type=ip&ip=".$ip)); 
//echo print_r($data); 
echo '<img src="data:image/png;base64,'.utf8_decode($data->ip->countryimage->attributes()->small).'"> '.utf8_decode($data->ip->location->attributes()->city).' ('.utf8_decode($data->ip->location->attributes()->region).')'; 
?> 
相關問題