php 根据ip获取地区的方法

php 根据ip获取地区的方法

<?php
$ip=$_GET['ip'];
  header("Content-type:text/html;charset=utf-8");
require('phpQuery/phpQuery.php');
$info=file_get_contents("https://ipchaxun.com/".$ip."/");
$eg2=phpQuery::newDocument($info);
print_r(pq('.value:eq(1)')->html());

 

posted @ 2021-02-23 21:41  newmiracle宇宙  阅读(731)  评论(0编辑  收藏  举报