-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Reza Salarmehr
committed
Jan 30, 2020
1 parent
e519ead
commit 67983cb
Showing
5 changed files
with
74 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php // example.php | ||
|
||
use Salarmehr\Cosmopolitan; | ||
|
||
require_once '../vendor/autoload.php'; | ||
|
||
foreach (['en', 'en_UK', 'de_DE', 'zh_CH', 'fa_IR'] as $locale) { | ||
|
||
$intl = new \Salarmehr\Cosmopolitan\Intl($locale, 'Australia/Sydney'); | ||
// or using the helper $intl=intl($locale); | ||
|
||
// $language = $intl->language(\Locale::getPrimaryLanguage($locale)); | ||
// $country = $intl->country(\Locale::getRegion($locale)); | ||
|
||
echo $intl->language('en') . "\n"; | ||
echo $intl->country('AU') . "\n"; | ||
echo $intl->datetime(time()) . "\n"; | ||
echo $intl->datetime(time()) . "\n"; | ||
echo $intl->ordinal(2) . "\n"; | ||
echo $intl->date(time(), Cosmopolitan\Intl::FULL) . "\n"; | ||
echo $intl->time(time(), Cosmopolitan\Intl::SHORT) . "\n"; | ||
echo $intl->quote("Reza!") . "\n"; | ||
echo $intl->number(123400.567) . "\n"; | ||
echo $intl->percentage(.14) . "\n"; | ||
echo $intl->spellout(10000000001) . "\n"; | ||
echo $intl->currency('AUD') . "\n"; | ||
echo $intl->money(12.3, 'AUD') . "\n"; | ||
echo $intl->duration(599) . "\n\n"; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters