Search

Showing 7 of 1,216 result(s)

/blog/2016/11/18/laravel-array-helper-function-array_divide

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...

/blog/2016/11/18/laravel-array-helper-function-array_dot

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 = '')...

/blog/2016/11/18/laravel-array-helper-function-array_except

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...

/blog/2016/11/18/laravel-array-helper-function-array_flatten

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...

/blog/2016/11/19/laravel-array-helper-function-array_first

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...

/blog/2016/11/19/laravel-array-helper-function-array_forget

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...

/blog/2016/11/19/laravel-array-helper-function-array_get

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....