互億無(wú)線(xiàn) · 文檔中心

身份證二要素 - 代碼示例


PHP對(duì)接身份證核驗(yàn)接口DEMO示例
本文為您提供了PHP語(yǔ)言版本的身份證二要素核驗(yàn)對(duì)接DEMO示例

身份證二要素接口文檔 點(diǎn)擊下載

身份證二要素接入指南 點(diǎn)擊訪問(wèn)



// 接口類(lèi)型:互億無(wú)線(xiàn)實(shí)名認(rèn)證接口
// 賬戶(hù)注冊(cè):https://user.ihuyi.com/register.html
// 注意事項(xiàng):
// DEMO僅作參考

header("Content-type:text/html; charset=UTF-8");

function Post($curlPost,$url){
		$curl = curl_init();
		curl_setopt($curl, CURLOPT_URL, $url);
		curl_setopt($curl, CURLOPT_HEADER, false);
		curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
		curl_setopt($curl, CURLOPT_NOBODY, true);
		curl_setopt($curl, CURLOPT_POST, true);
		curl_setopt($curl, CURLOPT_POSTFIELDS, $curlPost);
		$return_str = curl_exec($curl);
		curl_close($curl);
		return $return_str;
}

$account = 'APPID';
$password = 'APPKEY';
$app = 'id2';//固定值
$name = '張三';
$id_card_no = '123456789012345678';
$time = time();
$password = md5($account.$password.$name.$id_card_no.$time);

$target = "https://api.ihuyi.com/idcard/Submit.json";
$post_data = "account=".$account."&password=".$password."&app=".$app."&name=".$name."&id_card_no=".$id_card_no."&time=".$time;

//密碼可以使用明文密碼或使用32位MD5加密
$res =  Post($post_data, $target);
$res_json = json_decode($res,true);

print_r($res_json);

if($res_json['code']==2){
	echo "提交成功";
}

if($res_json['result']['status']==2){
	echo "認(rèn)證通過(guò)";
}

現(xiàn)在注冊(cè),即享新用戶(hù)禮包!

在線(xiàn)咨詢(xún)
電話(huà)咨詢(xún)

服務(wù)熱線(xiàn):

4008 808 898

服務(wù)熱線(xiàn)(工作時(shí)間):

4008 808 898

業(yè)務(wù)咨詢(xún)(非工作時(shí)間):

售后咨詢(xún)(非工作時(shí)間):

驗(yàn)證碼已發(fā)送到您的手機(jī),請(qǐng)查收!

輸入驗(yàn)證碼后,點(diǎn)擊“開(kāi)通體驗(yàn)賬戶(hù)”按鈕可立即開(kāi)通體驗(yàn)賬戶(hù)。

收不到短信驗(yàn)證碼?
互億無(wú)線(xiàn)不提供接碼服務(wù),接碼用戶(hù)請(qǐng)勿點(diǎn)擊開(kāi)通按鈕。
×