how to add values to an array in laravel
snippet in php

how to add values to an array in laravel

user7102

$array = array('foo' => 'bar');

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

php add element to array

user2857


<?php
$stack = array("orange", "banana");
array_push($stack, "apple", "raspberry");
?>