4

inarrayi

in_arrayi
SYNOPSIS

in_arrayi($s, $arr)

DESCRIPTION

in_arrayi returns true if the string of characters $s is in the array $arr. in_arrayi is case insensitive.

CODE
  1. function in_arrayi($s, $arr) {
  2.     foreach ($arr as $v) {
  3.         if (strcasecmp($s, $v) == 0) {
  4.             return true;
  5.         }
  6.     }
  7.  
  8.     return false;
  9. }

Comments

To add a comment, click here.