Case-insensitive array search
array_search(strtolower($search), array_map('strtolower', $array));
You can use in_array()
instead of array_search()
.
$response = in_array('yes', array_map('strtolower', $array));
array_search(strtolower($search), array_map('strtolower', $array));
You can use in_array()
instead of array_search()
.
$response = in_array('yes', array_map('strtolower', $array));