//返回手机号归属地
function get_mobile($id){
if(empty($id)) return '';
$rss = simplexml_load_file('http://www.youdao.com/smartresult-xml/search.s?type=mobile&q='.$id);
if($rss){
$data = (string)$rss->product->location;
}else{
$ctx = stream_context_create(array('http' => array('timeout' => 1)));  
$data = file_get_contents("http://apps.qiyigoo.com/telsearch/get_tel.php?do=get_tel_info&teltype=qq&phone=$id",0,$ctx);  
if(empty($data) || is_numeric($data))$data = '获取数据失败';
}
return $data;
}

声明:此文系舞林cuznwww.wulinlw.org)原创稿件,转载请保留版权

et_highlighter