News Feed
Sections




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

Developer Tutorials Blog:
Iterating PHP objects, and readable code too!
May 06, 2008 @ 14:34:58

The Developer Tutorials blog has a recent post that talks about manipulating objects in PHP with the help of the iterators that the Standard PHP Library has to offer.

It's a generally accepted fact that more readable code is more maintainable and easier for other developers to pick up. [...] Today I'm going to take a look at object iteration, most commonly found in the Standard PHP Library, and explore using the Iterator interface to simplify looping.

The main part of the tutorial shows how to implement the Iterator interface of the SPL to create your own custom methods, theirs being a Database version with methodsfor rewinding, reading and getting the current record you're working with.

0 comments voice your opinion now!
spl iterator tutorial database implement


blog comments powered by Disqus

Similar Posts

Davey Shafik: Everything You Need to Know About OpCode Caches

HowTo Forge: Installing Lighttpd With PHP5 And MySQL Support On Mandriva 2008.0

Daniel Cousineau's Blog: ImagePlane and some simple OOP designs

PHPMaster.com: Using SPL Iterators, Part 2

The Bakery: New Tutorials - PHPTAL, Multiple Checkboxes, and counterCache


Community Events

Don't see your event here?
Let us know!


conference extension install voicesoftheelephpant laravel library series framework symfony2 interview podcast api release php7 version performance opinion community example introduction

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework