helpers\BaseArrayHelper isSubset()

isSubset() public static method (available since version 2.0.7)

Checks whether an array or Traversable is a subset of another array or Traversable.

This method will return true, if all elements of $needles are contained in $haystack. If at least one element is missing, false will be returned.

public static boolean isSubset ( $needles, $haystack, $strict = false )
$needles array|Traversable

The values that must all be in $haystack.

$haystack array|Traversable

The set of value to search.

$strict boolean

Whether to enable strict (===) comparison.

return boolean

true if $needles is a subset of $haystack, false otherwise.

throws yii\base\InvalidParamException

if $haystack or $needles is neither traversable nor an array.

doc_Yii
2016-10-30 17:04:27
Comments
Leave a Comment

Please login to continue.