代码拉取完成,页面将自动刷新
Simplified Chinese Documentation
China (Mainland) ID card package, the data from the national standard
GB/T 2260-2007
(People's Republic of China administrative divisions code standard).
composer require ofcold/identity-card
A component based on People's Republic of China citizen ID card to obtain the user information.This works for any php framework, but only if the php version is greater than 7.1.
// Result false OR Ofcold\IdentityCard\IdentityCard instance.
$result = Ofcold\IdentityCard\IdentityCard::make('32010619831029081');
if ( $result === false ) {
return 'Your ID number is incorrect';
}
print_r($result->toArray());
php test
$idCard = Ofcold\IdentityCard\IdentityCard::make('320106198310290811', 'en');
// Use locale, Current supported zh-cn,en
// $idCard = Ofcold\IdentityCard\IdentityCard::make('320106198310290811', 'zh-cn');
if ( $idCard === false ) {
return 'Your ID number is incorrect';
}
$area = $idCard->getArea();
$gender = $idCard->getGender();
$birthday = $idCard->getBirthday();
$age = $idCard->getAge();
$constellation = $idCard->getConstellation();
{
"area": "shan xi sheng yun cheng di qu yun cheng shi",
"province": "shan xi sheng",
"city": "yun cheng di qu",
"county": "yun cheng shi",
"gender": "Male",
"birthday": "1980-03-12",
"zodiac": "Pig",
"age": 38,
"constellation": "Pisces"
}
Get Area
Get constellation
Get zodiac
Get age
Get birthday
Get gender
Get county
Get city
Get province
Get all information.
Json format all information
V2.0.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。