1$myArr = [1, 2, 3, 4];
2
3array_push($myArr, 5, 8);
4print_r($myArr); // [1, 2, 3, 4, 5, 8]
5
6$myArr[] = -1;
7print_r($myArr); // [1, 2, 3, 4, 5, 8, -1]
1<?php
2
3$a=array("red","green");
4
5array_push($a,"blue","yellow");
6
7print_r($a);
8?>
1$cart = array();
2$cart[] = 13;
3$cart[] = 14;
4// etc
5
6//Above is correct. but below one is for further understanding
7$cart = array();
8for($i=0;$i<=5;$i++){
9 $cart[] = $i;
10}
11echo "<pre>";
12print_r($cart);
13echo "</pre>";
14