[PHP] setlocale()

setlocale() (funzione PHP) imposta le informazioni locali (linguaggio, moneta, numeri, tempo).

tips&tricks

Sintassi

setlocale($costante, $luogo)
parametro descrizione
$costante LC_ALL – Tutte le categorie
LC_COLLATE – Sort order
LC_CTYPE – Character classification and conversion (e.g. all characters should be lower or upper-case)
LC_MESSAGES – System message formatting
LC_MONETARY – Monetary/currency formatting
LC_NUMERIC – Numeric formatting
LC_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

Fonti esterne

funzioni php, php

Related Articles

0 Comment