PHP code example of rocketfellows / es-vat-format-validator
1. Go to this page and download the library: Download rocketfellows/es-vat-format-validator library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
rocketfellows / es-vat-format-validator example snippets
$validator = new ESVatFormatValidator();
$validator->isValid('ESX12345678');
$validator->isValid('ES12345678X');
$validator->isValid('ESX1234567X');
$validator->isValid('12345678X');
$validator->isValid('X12345678');
$validator->isValid('X1234567X');
$validator = new ESVatFormatValidator();
$validator->isValid('ES123456789');
$validator->isValid('ES12345678XX');
$validator->isValid('ES1234567X');
$validator->isValid('ESX123456789');
$validator->isValid('ESX1234567');
$validator->isValid('ESXX1234567');
$validator->isValid('ESX1234');
$validator->isValid('ESX12345678X');
$validator->isValid('ESX1234567XX');
$validator->isValid('ESXX1234567X');
$validator->isValid('DE12345678X');
$validator->isValid('DEX12345678');
$validator->isValid('DEX1234567X');
$validator->isValid('12345678XX');
$validator->isValid('123456789X');
$validator->isValid('1234567X');
$validator->isValid('X123456789');
$validator->isValid('X1234567');
$validator->isValid('X12345679X');
$validator->isValid('X123456X');
$validator->isValid('123456789');
$validator->isValid('12345678');
$validator->isValid('1234567890');
$validator->isValid('');