abstrakt:<?php include 'function.php'; if(empty($_POST['phone'])){exit(json_encode(array('code'=>1,'msg'=>'手機(jī)號(hào)碼不能為空'))); } $url = "http://apis.juhe.cn/mobi
<?php
include 'function.php';
if(empty($_POST['phone'])){
exit(json_encode(array('code'=>1,'msg'=>'手機(jī)號(hào)碼不能為空')));
}
$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'=>'接口出錯(cuò)')));
}
Korrigierender Lehrer:查無此人Korrekturzeit:2019-02-22 09:07:00
Zusammenfassung des Lehrers:完成的不錯(cuò),以后代碼要縮進(jìn),加點(diǎn)注釋。繼續(xù)加油