<?php
// Soubor musí být uložen v UTF-8
// Collator
$collator = new Collator('cs_CZ');
$arr = array('Novák', 'Novakov', 'Žilina', 'Ábel', 'Atakdále');
$collator->sort($arr);
var_dump($arr);
echo "\n";
// IntlDateFormatter
$formatter = new IntlDateFormatter(
'cs_CZ',
IntlDateFormatter::FULL,
IntlDateFormatter::MEDIUM
);
echo 'Teď je ' . $formatter->format(time()) . "\n";
echo "\n";
$formatter = new IntlDateFormatter(
'cs_CZ',
IntlDateFormatter::FULL,
IntlDateFormatter::MEDIUM
);
echo 'Za měsíc a týden bude ' . $formatter->format(strtotime('+1 month +1 week')) . "\n";
echo "\n";
// NumberFormatter
$formatter = new NumberFormatter('cs_CZ', NumberFormatter::CURRENCY);
echo 'Mám ' . $formatter->format(1234567.89123) . "\n";
echo "\n";
$formatter = new NumberFormatter('tn_TN', NumberFormatter::CURRENCY);
echo 'Mám ' . $formatter->format(1234567.89123) . "\n";
echo "\n";
- Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.6 - 7.2.25, 7.3.0 - 7.3.12, 7.4.0
- array(5) {
[0]=>
string(5) "Ábel"
[1]=>
string(9) "Atakdále"
[2]=>
string(6) "Novák"
[3]=>
string(7) "Novakov"
[4]=>
string(7) "Žilina"
}
Teď je úterý 16. září 2014 17:47:50
Za měsíc a týden bude čtvrtek 23. října 2014 17:47:50
Mám 1 234 567,89 Kč
Mám TND 1234567.891
- Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29
- Fatal error: Class 'Collator' not found in /in/MIK91 on line 5
Process exited with code 255. - Output for 4.4.2 - 4.4.9
- Parse error: syntax error, unexpected ',', expecting '(' in /in/MIK91 on line 14
Process exited with code 255. - Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
- Parse error: parse error, unexpected ',', expecting '(' in /in/MIK91 on line 14
Process exited with code 255. - Output for 4.3.2 - 4.3.4
- Parse error: parse error, expecting `'('' in /in/MIK91 on line 14
Process exited with code 255.
preferences:
187.34 ms | 401 KiB | 248 Q