Skip to content

Commit

Permalink
Merge pull request #22 from someline/1.6
Browse files Browse the repository at this point in the history
Added in_arrayi for insensitive case in_array
  • Loading branch information
libern authored Aug 9, 2017
2 parents 850b1f4 + 293fc35 commit bf9d697
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 bf9d697

Please sign in to comment.