Add Array in Laravel

Submitted by Xubayer - 2 weeks ago

The array_add function adds a given key / value pair to the array if the given key doesn't already exist in the array.

$array = ['foo' => 'bar'];

$array = array_add($array, 'key', 'value');

Ads cover the costs of maintaining Laravel-tricks

comments powered by Disqus

Ads cover the costs of maintaining Laravel-tricks