<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Tue, 21 May 2013 09:06:00 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Stefan Koopmanschap's Blog: GlobIterator: Easy access to specific files]]></title>
      <guid>http://www.phpdeveloper.org/news/17828</guid>
      <link>http://www.phpdeveloper.org/news/17828</link>
      <description><![CDATA[<p>
<i>Stefan Koopmanschap</i> has a new post to his blog showing a <a href="http://www.leftontheweb.com/message/GlobIterator_Easy_access_to_specific_files">handy use of the GlobIterator</a> to access only certain files.
</p>
<blockquote>
For a project I am working on I needed to iterate over all .xml files in a specific directory. I started out with a DirectoryIterator, then considered I didn't want the XML filtering to take place inside my foreach loop. I decided to add a FilterIterator to the setup, but then felt this was not the right solution either. So I turned to my favorite SPL guru, <a href="http://adayinthelifeof.nl/">Joshua Thijssen</a>, to see if I was overseeing some kind of filter-option in the DirectoryIterator. I didn't, but I did oversee something else: <a href="http://php.net/globiterator">GlobIterator</a>.
</blockquote>
<p>
The GlobIterator lets you use functionality similar to the <a href="http://php.net/glob">glob</a> function (including being able to use wildcards in file searching) and get the resulting list back as a set of SplFileInfo objects, complete with additional metadata that can be extracted. 
</p>]]></description>
      <pubDate>Tue, 17 Apr 2012 12:43:42 -0500</pubDate>
    </item>
  </channel>
</rss>
