Skip to content

Instantly share code, notes, and snippets.

Forked from sepehr/in_arrayi.php
Created January 23, 2018 11:48
What would you like to do?
PHP: Case-insensitive in_array()
* Case-insensitive in_array() wrapper.
* @param mixed $needle Value to seek.
* @param array $haystack Array to seek in.
* @return bool
function in_arrayi($needle, $haystack)
return in_array(strtolower($needle), array_map('strtolower', $haystack));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment