Showing 7 of 1,216 result(s)
The collapse helper method accepts an array as its only parameter. The given $array can be a single array, or a nested array. The method will then return a new array with the contents of all the nested arrays. Arrays that are collapsed can contain...
The where helper method is functionally similar to the pluck method, in that both take a source $array and filter it to produce a smaller array. It works by iterating over each element in the $array and executing the $callback on each key value...
The exists helper method is similar to PHP's array_key_exists function in that in can be used to check if the given $key or index exists with the provided $array . The exists method defines two parameters, and both are required. Any value that...
The accessible helper method is used to determine whether the given $value is array accessible. A value $value is array accessible if the value is an array or an instance of ArrayAccess .The signature of the accessible method is:The following...
At some point in your PHP adventures, you have either seen, or written code like the following: The wrap method allows you to accomplish the same task with much cleaner, and clearer syntax.
The except helper method will return all the key/value pairs of the $array where the keys in the original array are not in the $keys array.
The only method can be used to retrieve a subset of the provided array. The subset of the returned array is based on the values supplied to the $key parameter.