I have an array like this:
$array = ['oooo', 'no', 'mmmm', 'yes'];
I'd like to search for a word "yes". I know about array_search()
, but I'd like to match "yes", "Yes" and "YES" as well.
How can I do this?
array_search(strtolower($search), array_map('strtolower', $array));