久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

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

      php怎么實(shí)現(xiàn)三網(wǎng)手機(jī)實(shí)名制認(rèn)證

      實(shí)現(xiàn)方法:1、申請(qǐng)開(kāi)通申請(qǐng)三網(wǎng)手機(jī)實(shí)名認(rèn)證API接口,獲取API請(qǐng)求KEY;2、用“$params=compact('key','realname','idcard','mobile','showid')”組合請(qǐng)求參數(shù);3、通過(guò)“function juhecurl($url,$params=false,$ispost=0){…}”方式發(fā)出請(qǐng)求,處理數(shù)據(jù)并返回結(jié)果即可。

      php怎么實(shí)現(xiàn)三網(wǎng)手機(jī)實(shí)名制認(rèn)證

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

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

      基于PHP的三網(wǎng)手機(jī)實(shí)名認(rèn)證API接口調(diào)用示例

      申請(qǐng)三網(wǎng)手機(jī)實(shí)名認(rèn)證API接口

      通過(guò) https://www.juhe.cn/docs/api/id/208?s=cpphpcn 自助申請(qǐng)開(kāi)通接口,獲取API請(qǐng)求KEY

      請(qǐng)求參數(shù)

      名稱(chēng) 必填 說(shuō)明
      key 在個(gè)人中心->我的數(shù)據(jù),接口名稱(chēng)上方查看
      realname 姓名
      idcard 身份證號(hào)碼
      mobile 手機(jī)號(hào)碼
      type 1:返回手機(jī)運(yùn)營(yíng)商,不輸入及其他值則不返回
      showid 1:返回聚合訂單號(hào),不輸入及其他值則不返回
      province 1:返回手機(jī)號(hào)歸屬地,province,city,不輸入不返回
      detail 是否顯示匹配詳情碼,傳1顯示,默認(rèn)不顯示(簡(jiǎn)版情況下輸入1的時(shí)候,固定返回24)

      PHP示例代碼

      如需請(qǐng)求加密接口,加密方式請(qǐng)參考 https://www.sdk.cn/details/d591E8oY9X9r67veZz

      $apiurl="http://v.juhe.cn/telecom/query";//請(qǐng)求地址 $key = "";//32位的KEY $realname = "";//真實(shí)姓名 $idcard="";//身份證號(hào)碼 $mobile="";//手機(jī)號(hào)碼 $showid=1;//傳入返回單號(hào) $params=compact('key','realname','idcard','mobile','showid');//組合請(qǐng)求參數(shù) $content=juhecurl($apiurl,$params);//獲取接口返回內(nèi)容json字符串 $result = json_decode($content,true);//解析成數(shù)組 if($result){     if($result['error_code']=='0'){       echo $result['result']['res'].':'.$result['result']['resmsg'];                #print_r($result);     }else{         echo $result['error_code'].":".$result['reason'];     } }else{     echo "請(qǐng)求失敗"; }  //網(wǎng)絡(luò)請(qǐng)求方法  function juhecurl($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_CONNECTTIMEOUT , 3);         curl_setopt( $ch, CURLOPT_TIMEOUT , 8);         curl_setopt( $ch, CURLOPT_RETURNTRANSFER , true );         if ($params) {             if (is_array($params)) {                 $paramsString = http_build_query($params);             } else {                 $paramsString = $params;             }         } else {             $paramsString = "";         }            if( $ispost )         {             curl_setopt( $ch , CURLOPT_POST , true );             curl_setopt( $ch , CURLOPT_POSTFIELDS , $paramsString);             curl_setopt( $ch , CURLOPT_URL , $url );         }         else         {             if($paramsString ){                 curl_setopt( $ch , CURLOPT_URL , $url.'?'.$paramsString);             }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ù)制

      返回結(jié)果示例

      {     "reason": "查詢(xún)成功",     "result": {         "realname": "***",         "mobile": "***********",         "idcard": "******************",         "res": 2,         "resmsg": "三要素身份驗(yàn)證不一致",          "type": "移動(dòng)",         "orderid":"J201712251904163782Ay",         "province":"廣東省",         "city" : "惠州市",         "rescode":"24"     },     "error_code": 0 }
      登錄后復(fù)制

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

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