The PHP add to array function: array_push()

There are two ways to add an element to the end of an array in PHP.

// Create an array$a=newarray("apple","orange");// Add an element to the end of the array using the array_push() functionarray_push($a,"banana")// Alternative way of adding an element to the end of an array$a[]="pineapple";// Adding an element with a key$a['fruit']="watermelon";