how do perform a case insensitive search in an array?
Posted: Tue Oct 26, 2004 3:02 am
Hello
Given the following array:
Is there an easy way to determine if the string 'AaA' is in the array? Note that I need to perform a case insensitive search, which means that for strings 'AaA', 'AAA', 'aaa' and 'aaA' the answer should be true.
Note that I don't want to modify the array and its values should remain intact
If I check
I get $index = false
regards
Given the following array:
Code: Select all
$arr = Array('aaa', 'bbb', 'ccc');Note that I don't want to modify the array and its values should remain intact
If I check
Code: Select all
$index = array_search('AaA', $arr);regards