# https://www.php.net/manual/en/function.in-array.php#89256
For a case-insensitive in_array(), you can use array_map() to avoid a foreach statement, e.g.:
<?php
function in_arrayi($needle, $haystack) {
return in_array(strtolower($needle), array_map('strtolower', $haystack));
}