Functions::isIn($needle,$haystack[,$haytack...])

Version 4

Check if needle is found in haystack

A: Replace PHP stripos() with more readable form and better lang -support. (Is case insensitive) B: Check if given valus is found in array

Return value

Bool

Arguments

$needle string
string Text to search for
array Multiple search texts
$haystack string
string to search from
array List of values to compare against

Full documentation

Note:

Check if needle is in haystack:

if ( isIn('me','memory') ){
    // me was found
}

Multiple needles:

if ( isIn( Array('me','ney') , 'money' ) ){
    // me and/or you was found in money
}

Check if needle is same as one of preceding values:

if ( isIn('name','phone','name') ){
    // name is one of the preceding values
}

Check if needle is in array

if ( isIn('name',Array('phone','name') ){
    // name is a value in array
}