note 102235 added to function.setlocale
| From: | merlijn at bntnederland dot nl | Date: | Thu, 03 Feb 2011 13:59:59 +0000 |
| Subject: | note 102235 added to function.setlocale | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-176632@lists.php.net to get a copy of this message | ||
warning, the code example of Anonymous 07-Aug-2010 05:18 doesn't work as expected anymore.
setlocale needs a parameter 0, instead of null, now to return the "old" (current) locale
value.
so the function needs to be
<?php
function getlocale($category) {
return setlocale($category, 0);
}
?>
This is off-course in the manual, but easily overlooked. And i am pretty sure it's a recent
change. It got me debugging and wondering for a while.
----
Server IP: 91.199.167.223
Probable Submitter: 213.125.24.93
----
Manual Page -- http://www.php.net/manual/en/function.setlocale.php
Edit -- https://master.php.net/note/edit/102235
Del: integrated -- https://master.php.net/note/delete/102235/integrated
Del: useless -- https://master.php.net/note/delete/102235/useless
Del: bad code -- https://master.php.net/note/delete/102235/bad+code
Del: spam -- https://master.php.net/note/delete/102235/spam
Del: non-english -- https://master.php.net/note/delete/102235/non-english
Del: in docs -- https://master.php.net/note/delete/102235/in+docs
Del: other reasons-- https://master.php.net/note/delete/102235
Reject -- https://master.php.net/note/reject/102235
Search -- https://master.php.net/manage/user-notes.php