Category Archives for PHP

How to Use array_pop() Function in PHP

array_pop function pops or removes the last value of an array. It’s used to shorten any array. Let’s see how this works. Output will look like this : Array ( [0] => The Beatles [1] => The Doors [2] => Dire Straits ) Here array_pop() function removed the last value of the array.

Continue reading

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 […]

Continue reading