This tutorial uses array_push() function to insert or append a new element to end of the Array.

PHP – Append Element to Array

The following example creates an initial array with two elements (as “black”,”blue”). After that add use array_push() function to append new element “white” to the array.

Output: