Copy code The code is as follows:
$ip="www.jb51.net"; //$ The ip can be changed to other domain names or ip addresses at will
$source=file_get_contents('http://www.ip138.com/ips.asp?ip='.$ip.'&action=2');
//Regular matching
preg_match_all("/
(.*)/isU",$source,$result);
print_r($result[1]);
?>
Output result:
XML/HTML code
Copy code The code is as follows:
Array
(
[0] => Main data of this site: United States
[1] => Reference data one: United States
[2] => Reference data 2: Google Inc., Mountain View, California, USA
)
http://www.bkjia.com/PHPjc/321294.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/321294.htmlTechArticleCopy the code as follows: ?Php $ip="www.jb51.net"; //$ip can be arbitrary Change to another domain name or IP address $source=file_get_contents('http://www.ip138.com/ips.asp?ip='.$ip.' //Regular match...