Download the PHP package phalapi/id-card-of-china without Composer

On this page you can find all versions of the php package phalapi/id-card-of-china. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package id-card-of-china

Identity Card Of China (PHP)

中华人民共和国身份证(The identity card of the people's Republic of China)

Build Status

JavaScript 版本:https://github.com/medz/id-card-of-china-js

id-card-of-china 是一个基于「公民身份号码」规则获取公民身份号码中包含的基础信息组件。

更新说明

去除PHP严格模式,以免报错。

安装

我们使用 Composer 安装:

使用

遵循 PHP-MD 原则,这个工具不提供静态调用,所以使用需要进行对象实例化:

APIs

基于 PhalApi\IdentityCard\China\IdentityInterface 实例

region 对象 APIs

演示

疑问解答

  1. 问:为什么不添加年龄、星座还有属相等信息?

    答:因为年龄需要专门的时间组件去计算,星座如果是「粗略」计算可以获得,但是没有意义,属相更加复杂,负责任的转换这些属性都比简单转换复杂,简单转换出来的不够准确。同样也失去了包本身该有的功能,例如年龄可以交给「时间组件」等。

  2. 问:这个包到底干啥的?

    答:这个包就是提取公民身份号码所包含的基础信息

  3. 问:可以用来验证人或者其他的吗?

    答:不基于公安部的 API 验证的身份证组件都不能叫验证组件,现在所有的 ID Card 组件都只能提取公民身份号码所包含的信息,如果说验证,那唯一能验证的就是公民身份号码是否是一个合法的公民身份号码。

  4. 问:如何获取年龄? 答:例如在 PHP 中,获取年龄是一个很简单的时区,我用最快的例子,你依赖 nesbot/carbon 这个「时间工具」包,依赖代码:

    然后看我下面的 PHP 代码:

    好了,你打印下 $age 试试看!

LICENSE

This component follows the MIT open source agreement.


All versions of id-card-of-china with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
medz/gb-t-2260 Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package phalapi/id-card-of-china contains the following files

Loading the files please wait ....