News Feed
Jobs Feed
Sections




News Archive
MaltBlue.com:
Painless Data Traversal with PHP FilterIterators
October 25, 2012 @ 08:54:35

On the MaltBlue blog Matt Setter has a new post introducing you to using FilterIterators for data traversal:

There's load of ways to traverse data, especially in PHP where there are a variety of loops available; including while, do while, for and foreach. These are fine for normal structures, such as scalar and associative arrays. But what if you want to get a bit more fancy?

He includes a bit of code showing the typical looping approach that a lot of developers take and how, using a FilterIterator, you can extend the default and make a custom "accept" method to remove certain matching items from the data set.

0 comments voice your opinion now!
filteriterator data traversal filter spl iterator array


blog comments powered by Disqus

Similar Posts

Pierre-Alain Joye's Blog: ext/filter, API frozen (!) and fixes, 0.11.0 is out

Brandon Savage's Blog: Data Formatting: It IS Our Job

Thomas Weinart: What Iterators Can Do For You

PHPMaster.com: Building a Domain Model - Integrating Data Mappers

IBM developerWorks: SDO for PHP Demonstrations from php|tek


Community Events











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


introduction language interview development tool functional composer code example object podcast zendframework2 series unittest release community conference framework opinion testing

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