addd to array php code example
Example 1: php append element to array
array_push($cart, 13);
Example 2: php add element to array
<?php
$stack = array("orange", "banana");
array_push($stack, "apple", "raspberry");
?>
array_push($cart, 13);
<?php
$stack = array("orange", "banana");
array_push($stack, "apple", "raspberry");
?>