IP138 IP address query thief implementation code

  • 2020-03-31 20:19:32
  • OfStack

 
<?Php 
$ip="www.jb51.net"; //$IP can be changed to any other domain name or IP address
$source=file_get_contents('http://www.ip138.com/ips.asp?ip='.$ip.'&action=2'); 
//Regular match
preg_match_all("/<li>(.*)</li>/isU",$source,$result); 
print_r($result[1]); 
?> 

Output results:
XML/HTML code
 
Array 
( 
[0] =>  Master data: USA  
[1] =>  Reference number 1: the United States  
[2] =>  Reference number two: the United States   Google, mountain view, calif  
) 

Related articles: