How to Use array_push() Function in PHP

array_push() is used to push or add values into an array. This function treats the array as a pile or stack and pushes the values onto the end of the array.

For example :

Here, first we declared an array with some colors. Then with the array_push() function we added two more values to the array.

You can add as much values you like with this function.

Sharing is Caring
Imtiaz Rayhan

WordPress Enthusiast, Novice PHP Developer. Music Addict, The Beatles Fan. Conncect with me on Facebook, Google+ and Twitter.

Click Here to Leave a Comment Below 0 comments

Leave a Reply: