1、身份证认证
//身份证认证
$headers = array();
$AppCode = ""; //百度智能云AppCode
array_push($headers, "X-Bce-Signature:AppCode/" . "$AppCode");
array_push($headers, "Content-Type".":"."application/json;charset=UTF-8");
$realName = '姓名';
$cardNo = 身份证号码;
$url = "http://gwgp-yyiffyorazl.n.bdcloudapi.com"."/v1/check"."?cardNo=$cardNo&realName=$realName&"; //请求的网址
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, true);
var_dump(curl_exec($curl)); //认证结果
2、银行卡认证
//银行卡认证
$headers = array();
$AppCode = ""; //百度智能云AppCode
array_push($headers, "X-Bce-Signature:AppCode/" . "$AppCode");
array_push($headers, "Content-Type".":"."application/json;charset=UTF-8");
$url = "http://gwgp-4unagchqt24.n.bdcloudapi.com"."/bankcard_check/get"."?name=姓名&bankcard=银行卡号码&idcard=身份证号码&mobile=手机号码&"; //请求的网址
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, true);
var_dump(curl_exec($curl));//认证结果
3、这两个调的都是百度智能云的接口,AppCode可以去百度智能云购买获取