Skip to content

Commit

Permalink
Added in_arrayi for insensitive case in_array
Browse files Browse the repository at this point in the history
  • Loading branch information
libern committed Aug 9, 2017
1 parent d6d0bfa commit 293fc35
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Someline/Foundation/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,4 +263,13 @@ function str_contains_ascii_only($string)
return (preg_match('%^[ -~]+$%', $string, $m));
}

}

if (!function_exists('in_arrayi')) {

function in_arrayi($needle, $haystack)
{
return in_array(strtolower($needle), array_map('strtolower', $haystack));
}

}

0 comments on commit 293fc35

Please sign in to comment.