Hi guys i was wondering if there was a way for me to have a case insensitive search for foreach(). For example
<?php
$clamarr = array(
'i am high',
'i am low',
'i am Found'
);
function checkArray($arr, $search)
{
for each($arr as $key => $value)
{
$find = strpos($value, $search);
if ($find !== false)
{
return $key;
}
}
return FALSE;
}
$result = checkArray($clamarr, found);
if ($result !== FALSE)
{
echo $result;
}else{
echo "not found";
}
?>
The main purpose of this is that i would be using this method for several arrays and in each array the case of the word found would be different (i.e. Found, found, FOUND) so i was thinking if there was a way for me to traverse the arrays with the method instead of manually substituting the value "found" for all the different arrays.