Home > Backend Development > PHP Tutorial > IP138 IP地址查询小偷实现代码_php实例

IP138 IP地址查询小偷实现代码_php实例

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:25:59
Original
1047 people have browsed it
复制代码 代码如下:

$ip="www.php.net"; //$ip可以任意改成其他域名或者是ip地址
$source=file_get_contents('http://www.ip138.com/ips.asp?ip='.$ip.'&action=2');
//正则匹配
preg_match_all("/
  • (.*)/isU",$source,$result);
    print_r($result[1]);
    ?>

  • 输出结果:
    XML/HTML代码
    复制代码 代码如下:

    Array
    (
    [0] => 本站主数据:美国
    [1] => 参考数据一:美国
    [2] => 参考数据二:美国 加利福尼亚州山景市谷歌公司
    )
    Related labels:
    source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template