PHP code example of labrodev / postal-formatter

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

    

labrodev / postal-formatter example snippets


use Labrodev\PostalFormatter\Utilities\PostalFormatter;

// Default usage: just clean and normalize
echo PostalFormatter::format(' 12345 '); // "12345"

// With country-specific formatting:
echo PostalFormatter::format('12345', 'CZ'); // "123 45"
echo PostalFormatter::format('sw1a1aa', 'GB'); // "SW1A 1AA"
echo PostalFormatter::format('1050', 'LV'); // "LV-1050"

composer install
composer analyse