How to change locale in PHP?
I tried to use setlocale in php, but it doesn't seem to be working according to the documentation (https://www.php.net/manual/en/function.setlocale.php). What I get is that the locale stays put to "C".
For example, see: https://jellby.altervista.org/test.php
code:
Code:
<p>
<?php
$cl = setlocale(LC_ALL, 'it_IT');
$cl = setlocale(LC_ALL, 0);
echo $cl;
echo '<br/>';
echo strftime("%e %B %Y");
?>
</p>
result:
Code:
<p>
C<br/>21 November 2020</p>
I also added at the end:
Code:
echo join('<br/>', resourcebundle_locales(''));
to check that the locale is actually supposed to be available