$a = array(); $a[] = 1; $a[] = 2; $a[] = 3; print_r($a);This is a nice / compact syntax but not immediately guessable. This will output:
Array ( [0] => 1 [1] => 2 [2] => 3 )If you want to add multiple elements, use array_push(). For example:
array_push($a, 100, 200, 300);