Download the PHP package ionepub/idcard without Composer

On this page you can find all versions of the php package ionepub/idcard. 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 idcard

idcard

二代身份证号码验证,可用于验证二代身份证号码是否合法、从身份证号码中获取生日/性别/年龄/地区信息 A Chinese identity card number verification class

安装

使用composer安装(建议)

tip

如果composer require ionepub/idcard时报错:

需要先执行一次 composer update nothing,再执行require就可以了

直接下载

下载地址:https://github.com/ionepub/idcard/releases

使用

引入包

实例化

或直接使用

设置一个身份证号

也可以在创建实例时设置:

设置身份证号的方法支持链式操作

获取身份证号

可以跟设置连起来用:

检查身份证号码格式是否正确

通过身份证号获取生日

可以通过给getBirthday()方法传递一个分隔符参数来设置返回的生日格式,默认-

通过身份证号获取年龄

通过身份证号获取性别

可以通过给getGender()方法传递一个语言参数来设置返回的性格语言,默认中文

通过身份证号获取所在地区

可以通过给getRegion()方法传递一个分隔符来设置返回的地区信息格式,默认空格

输出带*号的身份证号

有时候需要在输出身份证号的时候做一些字符处理,通过format()方法可以方便的转换成前4位+N×*+后4位格式

可以通过向format()方法传递一个分隔符参数来设置隐藏的数字替换符号,默认*

可以通过向format()方法传递一个左位数参数来设置左侧需要保留的位数

可以通过向format()方法传递一个右位数参数来设置右侧需要保留的位数

需要注意的是,左位数和右位数之和如果跟身份证号码总长度一致,就是原样输出,如果大于号码长度,则返回false


All versions of idcard with dependencies

PHP Build Version
Package Version
No informations.
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 ionepub/idcard contains the following files

Loading the files please wait ....