add item to array in php
snippet in php

php append element to array

user4950

array_push($cart, 13);

add item to array in php

user9965

<?php

$a=array("red","green");

array_push($a,"blue","yellow");

print_r($a);
?>

how to insert array php

user8928


<?php

$a=array("red","green");

array_push($a,"blue","yellow");

print_r($a);
?>