PHP code example of icanboogie / bind-cldr
1. Go to this page and download the library: Download icanboogie/bind-cldr 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/ */
icanboogie / bind-cldr example snippets
$app = ICanBoogie\boot();
# Getting the CLDR
echo get_class($app->cldr); // ICanBoogie\CLDR\Repository
echo $app->cldr->locales['fr']['languages']['fr']; // français
# Getting the current locale, defaulting to 'en' locale
echo get_class($app->locale); // ICanBoogie\CLDR\Locale
echo $app->locale; // en
# Setting the current locale to French
$app->locale = 'fr-FR';
echo get_class($app->locale); // ICanBoogie\CLDR\Locale
echo $app->locale; // fr-FR
echo $app->language; // fr