Summary

In this hour, you learned about arrays and some of the many tools PHP provides to work with them. You should now be able to create both numerically indexed and associative arrays and output data from them using a foreach loop.

You should be able to combine arrays to create multidimensional arrays and loop through the information they contain. You learned how to manipulate arrays by adding or removing multiple elements and examined some of the techniques PHP makes available to sort arrays. Finally, you learned about functions that use array-like indexing to help make your own functions more flexible.

In Hour 8, “Working with Strings,” we complete our tour of PHP fundamentals by taking a look at PHP’s support for objects. PHP developers ...

Get Sams Teach Yourself PHP in 24 Hours, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.