Implementation method: 1. Apply to open the three-network mobile phone real-name authentication API interface and obtain the API request KEY; 2. Use "$params=compact('key','realname','idcard','mobile ','showid')" combined request parameters; 3. Make a request through "function juhecurl($url,$params=false,$ispost=0){...}", process the data and return the result.
The operating environment of this tutorial: windows7 system, PHP8.1 version, DELL G3 computer
Based on PHP Example of calling the real-name mobile phone real-name authentication API interface
Apply for the three-network mobile phone real-name authentication API interface
Passed https://www.juhe.cn/docs/api/id/208?s=cpphpcn
Self-service application to open the interface and obtain the API request KEY
Request parameters
Required | Description | |
---|---|---|
is | In Personal Center->My Data, view above the interface name | ##realname |
Name | idcard | |
ID card number | mobile | |
Mobile phone number | type | |
1: Return to the mobile phone operator, If no other values are entered, it will not be returned. | ##province | |
1: Return to the location of the mobile phone number, province, city. If you do not enter it, it will not return | detail | |
Whether to display the matching detail code, pass 1 to display, the default is not to display (in the simplified version, when 1 is entered, 24 is returned) | ||
If you need to request an encryption interface, please refer to | https://www.sdk for the encryption method .cn/details/d591E8oY9X9r67veZz |
{ "reason": "查询成功", "result": { "realname": "***", "mobile": "***********", "idcard": "******************", "res": 2, "resmsg": "三要素身份验证不一致", "type": "移动", "orderid":"J201712251904163782Ay", "province":"广东省", "city" : "惠州市", "rescode":"24" }, "error_code": 0 }
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of How to implement real-name authentication for three-network mobile phones in PHP. For more information, please follow other related articles on the PHP Chinese website!