note 35085 added to function.date

From: Date: Tue, 19 Aug 2003 10:09:20 +0000
Subject: note 35085 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-54641@lists.php.net to get a copy of this message
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 ---- Manual Page -- http://www.php.net/manual/en/function.date.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35085 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35085&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35085&report=yes

« previous php.notes (#54641) next »