PHP code example of rocketfellows / che-vat-format-validator

1. Go to this page and download the library: Download rocketfellows/che-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 / che-vat-format-validator example snippets


$validator = new CHEVatFormatValidator();
$validator->isValid('CHE-123.456.789 MWST');
$validator->isValid('CHE-123.456.789 TVA');
$validator->isValid('CHE-123.456.789 IVA');

$validator = new CHEVatFormatValidator();
$validator->isValid('CHE-116.301.376 FOO');
$validator->isValid('CHE-116.301.37 MWST');
$validator->isValid('CHE-116.30.376 MWST');
$validator->isValid('CHE-11.301.376 MWST');
$validator->isValid('DE-111.301.376 MWST');
$validator->isValid('CHE-123.456.789 mwst');
$validator->isValid('CHE-123.456.789 tva');
$validator->isValid('CHE-123.456.789 iva');
$validator->isValid('che-123.456.789 MWST');
$validator->isValid('CHE-12.45.78 IVA');
$validator->isValid('CHE-123.456.789  IVA');
$validator->isValid('CHE-123.456.789IVA');
$validator->isValid('CHE- 123.456.789 IVA');
$validator->isValid('CHE123.456.789 IVA');
$validator->isValid('CHE 123.456.789 IVA');
$validator->isValid('CHE123456789IVA');
$validator->isValid('CHE-116.283.229');
$validator->isValid('CHE116.283.229');
$validator->isValid('116.283.229');
$validator->isValid('116283229');
$validator->isValid('1');
$validator->isValid('0');
$validator->isValid('');