<?php
include 'function.php';
if(empty($_POST['phone'])){
exit(json_encode(array('code'=>1,'msg'=>'手机号码不能为空')));
}
$url = "http://apis.juhe.cn/mobile/get";
$params = array(
"phone" => $_POST['phone'],
"key" => "4d6cce531387deeedf359687fb04c163",
);
$paramstring = http_build_query($params);
$content = juheCurl($url, $paramstring);
$result = json_decode($content, true);
if ($result) {
exit(json_encode(array('code'=>0,'res'=>$result)));
} else {
exit(json_encode(array('code'=>1,'msg'=>'接口出错')));
}