setlocale() (funzione PHP) imposta le informazioni locali (linguaggio, moneta, numeri, tempo).
tips&tricks
Sintassi
setlocale($costante, $luogo)
| parametro | descrizione |
|---|---|
| $costante |
LC_ALL – Tutte le categorieLC_COLLATE – Sort orderLC_CTYPE – Character classification and conversion (e.g. all characters should be lower or upper-case)LC_MESSAGES – System message formattingLC_MONETARY – Monetary/currency formattingLC_NUMERIC – Numeric formattingLC_TIME – Date and time formatting
|
Esempi
$number = 1234.56;
setlocale(LC_MONETARY,"it_IT");
echo money_format("%.2n", $number);
/* RISULTATO
EUR 1.234,56
*/
Contenuti correlati
- CSS
- HTML
- JavaScript
- jQuery
- PHP
- SQL
- WORDPRESS
0 Comment