PHP code example of davidvandertuijn / vat-validator

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

    

davidvandertuijn / vat-validator example snippets


use Davidvandertuijn\VatValidator\Validator as VatValidator;

$vatValidator = new VatValidator;

$vatValidator->validate('NL821783981B01'); // true

if ($vatValidator->isValid()) {
    $metaData = $vatValidator->getMetaData();
}

[
    "name" => "FLORO WEBDEVELOPMENT B.V.",
    "address" => "WESTBLAAK 00180 3012KN ROTTERDAM"
]

$vatValidator->setStrict(false); // default = true