{"id":22852135,"url":"https://github.com/alicfeng/identitycard","last_synced_at":"2025-04-06T21:16:38.218Z","repository":{"id":53821538,"uuid":"167586418","full_name":"alicfeng/IdentityCard","owner":"alicfeng","description":"中国（大陆）公民身份证工具类🔨用于身份证计算年龄、生日、星座、性别、生肖、政区划代码，同时绘制身份证正反面","archived":false,"fork":false,"pushed_at":"2024-02-26T09:38:30.000Z","size":20691,"stargazers_count":118,"open_issues_count":0,"forks_count":16,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-30T19:08:49.379Z","etag":null,"topics":["idcard","identitycard","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alicfeng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-25T17:30:23.000Z","updated_at":"2024-11-26T06:22:43.000Z","dependencies_parsed_at":"2024-06-21T14:37:45.488Z","dependency_job_id":null,"html_url":"https://github.com/alicfeng/IdentityCard","commit_stats":{"total_commits":33,"total_committers":3,"mean_commits":11.0,"dds":"0.18181818181818177","last_synced_commit":"9fcb64c00ee3a98ff1f8e3ca8b690cb52da5017c"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alicfeng%2FIdentityCard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alicfeng%2FIdentityCard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alicfeng%2FIdentityCard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alicfeng%2FIdentityCard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alicfeng","download_url":"https://codeload.github.com/alicfeng/IdentityCard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247550693,"owners_count":20956987,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["idcard","identitycard","php"],"created_at":"2024-12-13T06:07:19.116Z","updated_at":"2025-04-06T21:16:38.186Z","avatar_url":"https://github.com/alicfeng.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003ca href=\"https://github.com/alicfeng/identity-card\"\u003e\n    IdentityCard\n  \u003c/a\u003e\n\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n  中国（大陆）公民身份证类\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://packagist.org/packages/alicfeng/identity-card\"\u003e\n    \u003cimg src=\"https://poser.pugx.org/alicfeng/identity-card/v/stable.svg\" alt=\"Latest Stable Version\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://packagist.org/packages/alicfeng/IdentityCard\"\u003e\n    \u003cimg src=\"https://poser.pugx.org/alicfeng/identity-card/d/total.svg\" alt=\"Total Downloads\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://packagist.org/packages/alicfeng/identity-card\"\u003e\n    \u003cimg src=\"https://poser.pugx.org/alicfeng/identity-card/license.svg\" alt=\"License\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/alicfeng/IdentityCard\"\u003e\n    \u003cimg src=\"https://travis-ci.org/alicfeng/IdentityCard.svg?branch=master\" alt=\"build status\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\n\n## 🪤 快速安装\n\n```shell\ncomposer require \"alicfeng/identity-card\" --optimize-autoloader -vvv\n```\n\n\n\n## 🚀 快速使用\n\n```php\nuse AlicFeng\\IdentityCard\\Information;\n\n$id = 'IdentityCard';\n\n# 获取周岁 | \n$age = Information::identityCard()-\u003eage($id);\n\n# 获取生日\n$birthday = Information::identityCard()-\u003ebirthday($id);\n\n# 获取性别 | {男为M | 女为F}\n$sex = Information::identityCard()-\u003esex($id);\n\n# 获取生肖\n$constellation = Information::identityCard()-\u003econstellation($id);\n\n# 获取星座\n$star = Information::identityCard()-\u003estar($id);\n\n# 获取星座\n$star = Information::birthday()-\u003estar($birthday);\n\n# 获取年龄\n$age = Information::birthday()-\u003eage($id);\n\n# 生成身份证正面\n$front = Information::identityCard()-\u003ecreateFrontImage(...);\n\n# 生成身份证反面\n$back = Information::identityCard()-\u003ecreateBackImage(...);\n\n# 获取省\n$province = Information::identityCard()-\u003eprovince($id, $default='');\n\n# 获取市\n$city = Information::identityCard()-\u003ecity($id, $default='');\n\n# 获取区\n$area = Information::identityCard()-\u003earea($id, $default='');\n```\n___\n\n## 🏷 更新说明\n\n- **V1.0**\n\n  在版本 `1.0` 中，证件号码错误都是返回`false`。\n\n- **V2.0**\n\n  在版本 `2.0` 中添加异常捕获机制，证件错误将返回异常，只有`c::validate($id)`方法返回`bool`值。\n\n- **V2.3**\n\n  在版本 `2.3` 添加了一个新功能，可以提供身份证信息生成身份证图片。\n\n  注意：图片的大小为：865 * 540 px\n\n- **V3.0** - `2019.06.25`\n\n  在版本 `3.0` 添加了根据省份正号码获取省、市、区行政地区中文名称。\n  \n  行政地区编码源于[中华人民共和国民政部](http://www.mca.gov.cn/)，更新于 `2019-06-21`。\n\n- **V3.0.1** - `2019.11.05`\n\n  行政地区编码源于[中华人民共和国民政部](http://www.mca.gov.cn/)，更新于 `2019-11-05`。\n  \n- **V3.1.0** - `2020.02.23`\n\n  行政地区编码源于[中华人民共和国民政部](http://www.mca.gov.cn/)，更新于 `2020-02-19`。\n  \n  同时更新了内部实现的机制，调用的方法已经改变了，但是兼容低版本，建议更新旧的调用方法，将于2020.08.01不再支持旧的sdk\n\n- **V3.2.0** - `2024.02.26`\n  行政地区编码源于[中华人民共和国民政部](http://www.mca.gov.cn/)，更新于 `2023-04-23`。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falicfeng%2Fidentitycard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falicfeng%2Fidentitycard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falicfeng%2Fidentitycard/lists"}