PHP code example of grizzlyware / intl-zones

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

    

grizzlyware / intl-zones example snippets


use Grizzlyware\Intl\Zones\Zones;

$zones = Zones::forAlpha2Code('GB');

foreach ($zones as $zone) {
    echo "The name is: {$zone->name}" . PHP_EOL;
    
    if (null !== $zone->code) {
        echo "The code is: {$zone->code}" . PHP_EOL;
    } else {
        echo "No code available" . PHP_EOL;
    }
}

// Setting the locale (right now, only en is supported, and the default).
Zones::setLocale('en');