public static function in_iarray($needle, array $haystack)
    {
        foreach ($haystack as $key => $value) {
            if (strcasecmp($value, $needle) == 0) {
                return true;
            }
        }
        return false;
    }