note 44054 deleted from function.in-array by aidan
| From: | aidan@php.net | Date: | Wed, 18 Aug 2004 06:22:35 +0000 |
| Subject: | note 44054 deleted from function.in-array by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-74851@lists.php.net to get a copy of this message | ||
Note Submitter: timmie at goliathdesigns dot nl
----
Let's give you a (working!) case insensitive version of the in_array(); function.
<?php
function in_array_ci($item,$array) {
$object_found = false;
foreach($array as $arrayvalue) {
if(strtoupper($item) == strtoupper($arrayvalue)) {
$object_found = true;
}
}
return $object_found;
}
?>
Timmie