Exploring PHP array functions
Making full use of PHP involves taking advantages of the extensive function library. One area where this is particularly generous is in the handling of arrays, where more than seventy functions are offered. It is impossible to remember all of them, but when faced with some complex array handling, it is worth thinking carefully about how the standard functions might help. Cutting down the PHP source code through effective use of the functions can make a very large difference to performance, as well as reducing the amount of code to be maintained.
Partly because it involves complex selection processes, the area of menu handling makes use of a number of the more powerful array functions, as well as quite a few simpler ones.
Some simple ones are used to add and remove items from arrays when menu entries are being selected for the display of a particular menu. It is possible to add or remove entries from the beginning of an array through the use of array_unshift...