note 78870 added to function.array-change-key-case
| From: | felix dot gilcher at exozet dot com | Date: | Wed, 31 Oct 2007 10:54:17 +0000 |
| Subject: | note 78870 added to function.array-change-key-case | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-131857@lists.php.net to get a copy of this message | ||
Please, someone remove the note below by anonymous. Using
array_flip($array);
array_change_key_case($array);
array_flip($array);
to uppercase/lowercase all values is not only inefficient as hell, but also produces wrong results -
it will remove all duplicate values. The proper way to do this is using
array_map() and strtoupper()/strtolower()
thanks
----
Server IP: 212.124.37.9
Probable Submitter: 217.66.62.6
----
Manual Page -- http://www.php.net/manual/en/function.array-change-key-case.php
Edit -- https://master.php.net/note/edit/78870
Del: integrated -- https://master.php.net/note/delete/78870/integrated
Del: useless -- https://master.php.net/note/delete/78870/useless
Del: bad code -- https://master.php.net/note/delete/78870/bad+code
Del: spam -- https://master.php.net/note/delete/78870/spam
Del: non-english -- https://master.php.net/note/delete/78870/non-english
Del: in docs -- https://master.php.net/note/delete/78870/in+docs
Del: other reasons-- https://master.php.net/note/delete/78870
Reject -- https://master.php.net/note/reject/78870
Search -- https://master.php.net/manage/user-notes.php