array_push( ) pushes value onto the end of the array : array_push « Data Structure « PHP






array_push( ) pushes value onto the end of the array

 
//int array_push ( array &arr, mixed var [, mixed ...] )
<?
    $firstname = "Johnny";
    $names = array("Timmy", "Bobby", "Sam", "Tammy", "Joe");
    array_push($names, $firstname);
?>
  
  








Related examples in the same category

1.Adding an Element to the End of an Array
2.Adding array elements
3.array_push() function appends one or more values onto the end of the array.
4.Push one or more elements onto the beginning of array
5.Push one or more elements onto the end of array