PHP code example of tox82 / vatnumber-validator

1. Go to this page and download the library: Download tox82/vatnumber-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/ */

    

tox82 / vatnumber-validator example snippets


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