//通過身份證號查詢出性別與生日
$birth=strlen($idcard)==15 ? (ཏ'.substr($idcard, 6, 6)) :substr($idcard, 6, 8);
$sex=substr($idcard, (strlen($idcard)==15 ? -2 : -1), 1) % 2 ?Ƈ':Ɔ'//1為男 2為女
代碼如下復制代碼//通過身份證號查詢出性別與生日
if($data['cardtype'] =='idcard'){
$data['birth'] =strlen($data['cardno'])==15 ? (ཏ'.substr($data['cardno'], 6, 6)) :substr($data['cardno'], 6, 8);
$data['sex'] =substr($data['cardno'], (strlen($data['cardno'])==15 ? -2 : -1), 1) % 2 ?Ƈ':Ɔ'