Aplicaciones de la función setlocale()

Indique otro locale:  

Volver

Locale strcoll('ñ','n')
strcoll('ñ','o')
strtoupper() money_format() number_format()
localeconv()
strftime() nl_langinfo()
días de la semana
nl_langinfo()
meses
es_ES1
-1
ÁÉÍÓÚÑÜEUR 123.456,79EUR123456,7910/02/12 10:09:43domingo
lunes
martes
miércoles
jueves
viernes
sábado
enero
febrero
marzo
abril
mayo
junio
julio
agosto
septiembre
octubre
noviembre
diciembre
en_US8
-1
ÁÉÍÓÚÑÜUSD 123,456.79$123,456.7902/10/2012 10:09:43 AMSunday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
January
February
March
April
May
June
July
August
September
October
November
December

Este archivo


<?php
function linea($locale) {
       if ( 
setlocale(LC_ALL,$locale) != $locale) return;
       
$loc =localeconv();
       echo 
'<tr><td>',$locale
            
,'</td><td>',strcoll('ñ','n'),'<br />',strcoll('ñ','o')
            ,
'</td><td>'strtoupper('áéíóúñü')
            ,
'</td><td>',money_format('%i'123456.789)
            , 
'</td><td>',$loc['currency_symbol'] , number_format(123456.789,$loc['frac_digits'],$loc['decimal_point'],$loc['thousands_sep'])
            , 
'</td><td>',strftime('%x %X')
            , 
'</td><td>';
      for (
$i=1;$i<=7;$i++) echo nl_langinfo(constant('DAY_'.$i)),'<br/>';
      echo 
'</td><td>';
      for (
$i=1;$i<=12;$i++) echo nl_langinfo(constant('MON_'.$i)),'<br/>';
      echo 
'</td></tr>';
}

?>
<html>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
                <title>Aplicaciones de la función setlocale()</title>
</head>
<body>
<h1>Aplicaciones de la función setlocale()</h1>
<form method="get" action="index.php">
<p>Indique otro locale: <input type="text" name="locale" /> &nbsp; <input type="submit" name="submit" value="Aceptar" /></p>
</form>
<p align="right"><a href="../index.html">Volver</a></p>
<table border="1"><tr>
<th>Locale</th>
<th>strcoll('ñ','n')<br />strcoll('ñ','o')</th>
<th>strtoupper()</th>
<th>money_format()</th>
<th>number_format()<br/>localeconv()</th>
<th>strftime()</th>
<th>nl_langinfo()<br/>días de la semana</th>
<th>nl_langinfo()<br/>meses</th>
</tr>
<?php
$locale 
$_GET['locale'];
if (!
is_null($locale)) linea($locale);
linea('es_ES');
linea('es_MX');
linea('en_GB');
linea('en_US');
linea('nl_NL');
linea('ca_ES');
linea('pt_BR');
linea('pt_PT');
linea('ja_JP');
linea('el_GR');
?>
</table>
<h3>Este archivo</h3>
<pre><?php highlight_file('index.php'); ?> </pre>
</body></html>