array_unshift — Prepend one or more Elements to the beginning of an array.
array_unshift()
prepends passed elements to the front of the array. Note that the list of elements is prepended as a whole, so that the prepended elements stay in the same order. All numerical array keys will be modified to start counting from zero while literal keys won’t be changed.
Example #1 array_unshift() example
The above example will output:
Array ( [0] => apple [1] => raspberry [2] => orange [3] => banana )
The post PHP array_unshift() example appeared first on FreeWebMentor.
This post first appeared on Programming Blog Focused On Web Technologies, please read the originial post: here