October 2005
Intermediate to advanced
372 pages
11h 35m
English
array_push()
int array_push ( array&arr, mixedvar[, mixed ...] )
The array_push() function takes an array and a new value as its only parameter, and pushes that value onto the end of the array, after all the other elements. This is the opposite of the array_pop() function:
$firstname = "Johnny";
$names = array("Timmy", "Bobby", "Sam", "Tammy", "Joe");
array_push($names, $firstname);
// first is Timmy; last is now Johnny