具体如下:
true,
);
curl_setopt_array($ch,$options);
$res = curl_exec($ch);
curl_close($ch);
if($xml = simplexml_load_string($res)) {
$return = array();
foreach ($xml->Location->children() as $key=>$item) {
$return[$key] = strtolower($item);
}
return $return;
} else {
return false;
}
}
$current_Ip_Info = getIpInfo('119.7.8.255');
var_dump($current_Ip_Info);