note 47915 added to function.setlocale

From: Date: Sun, 05 Dec 2004 11:12:11 +0000
Subject: note 47915 added to function.setlocale
Groups: php.notes 
Request: Send a blank email to php-notes+get-81388@lists.php.net to get a copy of this message
string setlocale ( mixed category, string locale [, string ...]) In many cases I experienced that setlocale() does not work with date(), no matter which value you use as 'string locale': <?php setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'de-DE', 'de', 'ge', 'de_DE.ISO_8859-1', 'German'); echo date(F); ?> Instead you might want to use an array in order to store locale month-names, but in most cases using strftime() works fine, as well: <?php setlocale(LC_ALL, "de_DE"); echo strftime("%B"); ?> ---- Manual Page -- http://www.php.net/manual/en/function.setlocale.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+47915 Delete -- http://master.php.net/manage/user-notes.php?action=delete+47915&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47915&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47915&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47915&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47915&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47915&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+47915&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#81388) next »