sandorl195 / vatin
3.0.0
2019-03-20 15:12 UTC
Requires
- php: >=5.6.0
Requires (Dev)
- ext-soap: *
- phpunit/phpunit: ^5.7 || ^6.5
Suggests
- ext-soap: Required if you want to check the VAT number via VIES
README
A small PHP library for validating VAT identification numbers (VATINs).
安装
此库可在Packagist上找到
$ composer require ddeboer/vatin
如果您想在Symfony应用程序中使用此库,可以使用VatinBundle代替。
使用方法
验证增值税号的格式
use Ddeboer\Vatin\Validator; $validator = new Validator; $bool = $validator->isValid('NL123456789B01');
此外,还可以通过调用[VAT Information Exchange System (VIES)] (http://ec.europa.eu/taxation_customs/vies/faq.html#item_16) SOAP网络服务来检查增值税号是否在使用中
use Ddeboer\Vatin\Validator; $validator = new Validator; $bool = $validator->isValid('NL123456789B01', true);