abstract:<?php include 'function.php'; if(empty($_POST['phone'])){exit(json_encode(array('code'=>1,'msg'=>'手机号码不能为空'))); } $url = "http://apis.juhe.cn/mobi
<?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'=>'接口出错')));
}
Correcting teacher:查无此人Correction time:2019-02-22 09:07:00
Teacher's summary:完成的不错,以后代码要缩进,加点注释。继续加油