Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPBuilder:
Iterating through Life and PHP
Feb 26, 2003 @ 15:57:20

If you've ever worked with PHP an arrays, you'll know that they're a match made in heaven. There are tons of built-in PHP functions that allow you to twist, turn, and manipulate arrays to bend them to your will. In the latest article from PHPBuilder, they take it one step further, showing you how to build an "interator" to have more control over your arrays.

In PHP Iterator, the author shows you how to create a set of functions that can work with your PHP arrays and make it easier to use a standard interface to check values, add values, etc. They also create an "iteration" object that they use to perform the operations on the array, and can be reused later on to do more things.

This is an interesting idea for working with your arrays in PHP, but unless you're really used to using it, or think it wil help you and your code out a lot, then it might be better off in the "hey, that's cool" category.

tagged:

Link:


Trending Topics: