array_find() - A case insensitive array_search() with partial matches
<?php/** * Case in-sensitive array_search() with partial matches * * @param string $needle The string to search for. * @param array $haystack The array to search in. * * @author Bran van der Meer <branmovic@gmail.com> * @since 29-01-2010 */function array_find($needle, array $haystack){ foreach ($haystack as $key => $value) { if (false !== stripos($needle, $value)) { return $key; } } return false;}