PHP code example of vasildakov / postcode-validator

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

    

vasildakov / postcode-validator example snippets




$validator = new Postcode\Validator('UK');

var_dump($validator->isValid('EC1V 9LB')); // true
var_dump($validator->isValid('ABC1 XYZ')); // false



$validator = new Postcode\Validator('NL');

var_dump($validator->isValid('1012 JS')); // true
var_dump($validator->isValid('1234 JS')); // false