Validate Formatting of World-Wide Postal Codes
use Sirprize\PostalCodeValidator\Validator;
$validator = new Validator();
$validator->hasCountry('CH'); // returns true
use Sirprize\PostalCodeValidator\Validator;
$validator = new Validator();
$validator->isValid('CH', 'usjU87jsdf'); // returns false
$validator->isValid('CH', '3007'); // returns true
use Sirprize\PostalCodeValidator\Validator;
$validator = new Validator();
$validator->getFormats('GB'); // returns array('@# #@@', '@** #@@', '@@#* #@@')
#
=0-9
@
=a-zA-Z
*
=a-zA-Z0-9
Postal-code-validator uses ISO 3166 2-letter country codes
See LICENSE.