note 102235 deleted from function.setlocale by danbrown
| From: | danbrown@php.net | Date: | Thu, 03 Feb 2011 14:27:58 +0000 |
| Subject: | note 102235 deleted from function.setlocale by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-176639@lists.php.net to get a copy of this message | ||
Note Submitter: merlijn at bntnederland dot nl
----
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.