Showing 7 of 1,216 result(s)
The divide helper method will take the given $array and create two new arrays. The first array will be all of the keys from the original $array and the second array will be all of the values. The final result would be:The array_divide function is...
The dot helper method will take a multi-dimensional array and return a new associative array where the keys are built from all the nested keys, separated with the . character. The signature for the dot helper method is: dot($array, $prepend = '')...
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 signature for the except helper method is: except($array, $keys) Assuming that the $_POST super-global...
The flatten helper method is similar to the dot method in that it takes a multi-dimensional array and transforms it into a new array with only one dimension. While the dot method preserves the keys by separating them with dots , the flatten method...
first($array, callable $callback = null, $default = null) Let's begin discussing the first helper method be examining the $callback . The $callback is a function that accepts a $key and a $value as its parameters. The following code sample is an...
forget(&$array, $keys) The forget helper method removes items from the given $array . The specified keys are express in dot notation. Mutable Function This function affects the original $array . Assuming an array is defined as follows: We could...
get($array, $key, $default = null) The get helper method will retrieve an item from the given $array using dot notation. This allows developers to retrieve items from the array at arbitrary depths quickly, without having to use PHP's array syntax....
The following amazing people help support this site and my open source projects ♥️
If you're interesting in supporting my work and want to show up on this list, check out my GitHub Sponsors Profile.