note 78870 deleted from function.array-change-key-case by felipe
| From: | felipe@php.net | Date: | Sun, 16 Dec 2007 11:13:57 +0000 |
| Subject: | note 78870 deleted from function.array-change-key-case by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-133649@lists.php.net to get a copy of this message | ||
Note Submitter: felix dot gilcher at exozet dot com
----
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