tox82/vatnumber-validator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

tox82/vatnumber-validator

Composer 安装命令:

composer require tox82/vatnumber-validator

包简介

A simple VAT identification number validator, without any dependencies, NOT relying on the VIES service.

README 文档

README

A formal VAT number validator

It's not a full validation tool, it just checks that the VAT number is formally valid: eg. 11 chars, digits only, etc. It's built using these rules:

It requires PHP >= 7.0.

Installation:

composer require tox82/vatnumber-validator

Usage

Just load the VatNumber class and execute a check, passing the country code and VAT code as parameters, and it will return a boolean value. True for valid VAT number, false for invalid.

use Tox82\VatNumber;

...

echo VatNumber::check('FR', '12345678901'); // true
echo VatNumber::check('HU', '12345678'); // true
echo VatNumber::check('PT', '123456789'); // true
echo VatNumber::check('SE', '123456789012'); // true

echo VatNumber::check('AT', 'U123456780'); // false because of invalid number's length
echo VatNumber::check('MK', 'AA4032013544513'); // false because of  invalid characters

TODO

Add specific, more robust validation for each country, when available. Eg. check digits. prefixes, suffixes, etc.

Resources

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2022-01-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固