Skip to content

Instantly share code, notes, and snippets.

@hlassiege
Created May 3, 2018 09:28
Show Gist options
  • Save hlassiege/905cfa5272e17cb3a8de95ee1f9b0c4b to your computer and use it in GitHub Desktop.
Save hlassiege/905cfa5272e17cb3a8de95ee1f9b0c4b to your computer and use it in GitHub Desktop.
formatwithpear.php
require_once 'I18Nv2.php';
$locale = &I18Nv2::createLocale('en_US');
echo "Format a currency value of 2000: ",
$locale->formatCurrency(2000, I18Nv2_CURRENCY_INTERNATIONAL), "\n";
echo "Format todays date: ",
$locale->formatDate(null, I18Nv2_DATETIME_FULL), "\n";
echo "Format number : ",
$locale->formatNumber(1234.56), "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment