发表日期:2019-09 文章编辑:小灯 浏览次数:2420
在需要的地方把下面一行复制过去就行,
号码归属地:{tel_location($mobile)}
然后把下面一段代码复制到/include/module.func.php文件中?>前面即可:
function tel_location($ip) {
$u = “https://www.youdao.com/smartresult-xml/search.s?type=mobile&q=$ip”;
$r = HttpRequest($u);
preg_match(“#<location>(.+)</location>#Ui”, $r, $m);
return iconv(“GBK”, “UTF-8//IGNORE”, strval($m[1]));
//echo strval($m[1]);
}function HttpRequest($url) {
if ( !function_exists(‘curl_init’) ) { return “<location>暂未能查询到</location>”; }
$timeout = 2;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
$result = curl_exec($ch);
return $result;
}
演示效果如下:
11日期:2019-09 浏览次数:3036
日期:2019-09 浏览次数:2981
日期:2019-09 浏览次数:2981
日期:2019-09 浏览次数:2816
日期:2019-09 浏览次数:2872
日期:2019-09 浏览次数:2926
日期:2019-09 浏览次数:2881
日期:2019-09 浏览次数:3004
日期:2019-09 浏览次数:3316
日期:2019-09 浏览次数:2831
日期:2019-09 浏览次数:2913
日期:2019-09 浏览次数:2657
日期:2019-09 浏览次数:2698
日期:2019-09 浏览次数:2335
日期:2019-09 浏览次数:2442
日期:2019-09 浏览次数:2344
日期:2019-09 浏览次数:2399
日期:2019-09 浏览次数:2499
日期:2019-09 浏览次数:2417
日期:2019-09 浏览次数:2635
日期:2019-09 浏览次数:2539
日期:2019-09 浏览次数:2694
日期:2019-09 浏览次数:2419
日期:2019-09 浏览次数:2747
日期:2019-09 浏览次数:2582
日期:2019-09 浏览次数:2637
日期:2019-09 浏览次数:2545
日期:2019-09 浏览次数:2600
日期:2019-09 浏览次数:2471
日期:2019-09 浏览次数:2409
Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.