Re: Case-insensitive indexes
| From: | Justin Patrin | Date: | Wed, 28 Apr 2004 08:42:27 +0000 |
| Subject: | Re: Case-insensitive indexes | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-184842@lists.php.net to get a copy of this message | ||
Tumurbaatar S. wrote:
Is there a way to turn off case sensitivity of associative arrays? System arrays like $_REQUEST and arrays returned from 'fetch_array' db functions?AFAIK, no. Those things are and should always be case-sensitive. For $_REQUEST, just change your form element names ot the case you want them in. For DB functions, again, set up the tables witht he case you want. Of course, for some DBs (Oracle), you can't choose your case. In that case, you just have to bite the bullet or write your own wrapper for it. If you want to make all of the keys in an array lower case you could use this: foreach($arr as $key => $val) { unset($arr[$key]); $arr[strtolower($key)] = $val; } -- paperCrane <Justin Patrin>