isIn() public static method (available since version 2.0.7)
Check whether an array or Traversable contains an element.
This method does the same as the PHP function in_array() but additionally works for objects that implement the Traversable interface.
public static boolean isIn ( $needle, $haystack, $strict = false ) | ||
---|---|---|
$needle | mixed |
The value to look for. |
$haystack | array|Traversable |
The set of values to search. |
$strict | boolean |
Whether to enable strict ( |
return | boolean |
|
throws | yii\base\InvalidParamException |
if |
Please login to continue.