Showing 7 of 1,216 result(s)
The $callback function is an optional parameter, and can be omitted. When the $callback parameter is omitted, the last method will return the last item in the array:
The array_last function is a shortcut to calling Arr::last . This function is declared in the global namespace.
The signature of the flatten method is:
Consider the following array: If we flatten the array like so: the resulting array would be:
The array_flatten function is a shortcut to calling Arr::flatten . This function is declared in the global namespace.
The signature of the forget method is:
Assuming an array is defined as follows: We could remove the first_name value like so: Which would leave the array as follows: Removing multiple items at once is as simple as passing an array as the second argument: