| Implementing Arrays | | Print | |
In total, more than 60 functions currently are dedicated to array manipulation within PHP. Although there are far too many functions to cover in this book, almost all are documented extensively within the PHP documentation available at . Rather than simply reiterate the existing documentation, the focus of the remainder of this chapter will be on only the more advanced array functions and the application of those functions in scripts.
Now that you understand the formalities of the basic array, let's take a look at how arrays can be applied using the incredible number of array support functions available natively from within PHP.
Using an Array as a List
Perhaps one of the most common uses for an array is its use as a simple list. In fact, most of the examples discussed thus far have involved using the array as a simple list. In this section, we'll be looking at how a list using an array can be used to accomplish a specific taskthe automatic generation of the necessary HTML to display a group of images.
For this example, you'll define an array, $images, that will contain a list of all the different images that you will be displaying. You'll then use that array to create the necessary <IMG> HTML tags to display those images to the screen. shows the code.
| Users' Comments (0) |
|
No comment posted






