代码:
function get_onlineip() {
$ch = curl_init('http://iframe.ip138.com/ic.asp');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$a = curl_exec($ch);
preg_match('/\[(.*)\]/', $a, $ip);
return $ip[];
}
得到的是 113.91.122.205
代码:
function get_onlineip() {
$ch = curl_init('http://iframe.ip138.com/ic.asp');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$a = curl_exec($ch);
preg_match('/\[(.*)\]/', $a, $ip);
return $ip[];
}
得到的是 113.91.122.205