php добавя елемент в масив
array_push($cart, 13);
php добавя елемент в масив
<?php
$stack = array("orange", "banana");
array_push($stack, "apple", "raspberry");
?>
php вмъкнете в масив
$original = array( 'a', 'b', 'c', 'd', 'e' );
$inserted = array( 'x' ); // not necessarily an array, see manual quote
array_splice( $original, 3, 0, $inserted ); // splice in at position 3
// $original is now a b c x d e