亚洲最大看欧美片,亚洲图揄拍自拍另类图片,欧美精品v国产精品v呦,日本在线精品视频免费

  • 站長(zhǎng)資訊網(wǎng)
    最全最豐富的資訊網(wǎng)站

    PHP怎么查詢手機(jī)號(hào)碼歸屬地

    PHP查詢手機(jī)號(hào)碼歸屬地的方法:1、請(qǐng)求手機(jī)號(hào)碼歸屬查詢API;2、根據(jù)手機(jī)號(hào)碼或手機(jī)號(hào)碼的前7位,查詢手機(jī)號(hào)碼歸屬地信息;3、通過(guò)“function juheHttpRequest($url, $params = false, $ispost = 0){…}”方法請(qǐng)求接口返回內(nèi)容即可。

    PHP怎么查詢手機(jī)號(hào)碼歸屬地

    php入門(mén)到就業(yè)線上直播課:進(jìn)入學(xué)習(xí)
    Apipost = Postman + Swagger + Mock + Jmeter 超好用的API調(diào)試工具:點(diǎn)擊使用

    本教程操作環(huán)境:windows7系統(tǒng)、PHP8.1版、Dell G3電腦。

    PHP怎么查詢手機(jī)號(hào)碼歸屬地?

    基于PHP的手機(jī)號(hào)碼歸屬地查詢

    手機(jī)號(hào)碼(段)歸屬地查詢

    接口請(qǐng)求Key,可以通過(guò)https://www.juhe.cn/docs/api/id/11?s=cpphpcn免費(fèi)申請(qǐng)開(kāi)通

    $appkey = "*********************"; //根據(jù)手機(jī)號(hào)碼或手機(jī)號(hào)碼的前7位,查詢手機(jī)號(hào)碼歸屬地信息,如省份 、城市、運(yùn)營(yíng)商等。 $url = "http://apis.juhe.cn/mobile/get"; $params = [     "phone" => "1891234",//手機(jī)號(hào)碼或手機(jī)號(hào)碼的前7位     "key" => $appkey,//應(yīng)用APPKEY(應(yīng)用詳細(xì)頁(yè)查詢) ]; $paramstring = http_build_query($params); $content = juheHttpRequest($url, $paramstring, 1); $result = json_decode($content, true); if ($result) {     if ($result['error_code'] == 0) {         echo "省份:{$result['result']['province']}" . PHP_EOL;         echo "城市:{$result['result']['city']}" . PHP_EOL;         echo "區(qū)號(hào):{$result['result']['areacode']}" . PHP_EOL;         echo "運(yùn)營(yíng)商:{$result['result']['company']}" . PHP_EOL;     } else {         echo "{$result['error_code']}:{$result['reason']}" . PHP_EOL;     } } else {     echo "請(qǐng)求失敗"; } /**  * 請(qǐng)求接口返回內(nèi)容  * @param string $url [請(qǐng)求的URL地址]  * @param string $params [請(qǐng)求的參數(shù)]  * @param int $ipost [是否采用POST形式]  * @return  string  */ function juheHttpRequest($url, $params = false, $ispost = 0) {     $httpInfo = array();     $ch = curl_init();     curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);     curl_setopt($ch, CURLOPT_USERAGENT, 'JuheData');     curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);     curl_setopt($ch, CURLOPT_TIMEOUT, 5);     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);     if ($ispost) {         curl_setopt($ch, CURLOPT_POST, true);         curl_setopt($ch, CURLOPT_POSTFIELDS, $params);         curl_setopt($ch, CURLOPT_URL, $url);     } else {         if ($params) {             curl_setopt($ch, CURLOPT_URL, $url . '?' . $params);         } else {             curl_setopt($ch, CURLOPT_URL, $url);         }     }     $response = curl_exec($ch);     if ($response === FALSE) {         //echo "cURL Error: " . curl_error($ch);         return false;     }     $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);     $httpInfo = array_merge($httpInfo, curl_getinfo($ch));     curl_close($ch);     return $response; }
    登錄后復(fù)制

    推薦學(xué)習(xí):《PHP視頻教程》

    贊(0)
    分享到: 更多 (0)
    網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)