note 35085 deleted from function.date by sniper
| From: | sniper@php.net | Date: | Sat, 11 Oct 2003 16:55:20 +0000 |
| Subject: | note 35085 deleted from function.date by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-58302@lists.php.net to get a copy of this message | ||
Note Submitter: flemming AT joensson DOT org
----
Just a comment for the people writing their own arrays for Spanish, Italian, Swedish etc. to replace
day and month names.
Why not use the setlocale function?
It has been available since PHP3 - so I do not quite understand why you use replace functions or
your own arrays for that matter.
e.g. setlocale(LC_TIME,"Danish");
and voila you've got Danish week and month names using the strftime function (instead of the
date function). The possibilities are nearly the same in the two functions.
I think setlocale is an overlooked function when it comes to writing pages in languages other than
English with PHP. Perhaps this comment will help people realize that there is an alternative :)
Cheers,
Flemming