定制 wapacro/identity-validator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wapacro/identity-validator

Composer 安装命令:

composer require wapacro/identity-validator

包简介

Allows you to check identity cards and passports all over the world!

README 文档

README

Identity Validator is a package that allows you to verify a user by his identity card or passport. The package supports XML templates to easily handle the local differences between the format of the machine readable lines of different identity cards or passports. I've planned some cool stuff other than just verifying, so stay tuned!

Install

Since this is a Composer package, simply run the following command to install it:

composer require wapacro/identity-validator

Use

Let your user enter the machine readable line on his identity document and let this package do the magic! First, initialize the package;

$id = new \wapacro\IdentityValidator\IdentityValidator();

You can get a list of supported identity documents (and what country they belong to) by executing:

(array) $id->getSupportedTypes();

Then select the template you want to use. Select it by using the dot notation, which is shown as notation in the supported documents list. You can also pass the desired template in the constructor.

$id->setTemplate('CH.id');

So let's get to it; Add the machine readable lines, which your user entered:

$id->addMachineReadableLines('IDCHEE2556414<5<<<<<<<<<<<<<<<\n0006013M2102182CHE<<<<<<<<<<<8\nEXAMPLE<<JOE<<<<<<<<<<');

... and finally validate those lines:

(bool) $id->validateMachineReadableLines();

统计信息

  • 总下载量: 19
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-2-Clause
  • 更新时间: 2017-06-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固