News Feed
Sections
News Archive


Community Events






Developer Tutorials Blog:
Iterating PHP objects, and readable code too!
0 comments :: posted Tuesday May 06, 2008 @ 14:34:58
voice your opinion now!

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.

tagged with: spl iterator tutorial database implement



conference database release mysql framework developer application PHP5 releases pecl cakephp security package zendframework book job ajax PEAR code zend

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