Go to the documentation of this file.00001 <?php
00019 class axExtensionFilterIterator extends FilterIterator {
00020
00025 protected $_ext;
00026
00035 public function __construct (Iterator $iterator, $extension) {
00036 parent::__construct($iterator);
00037 $this->_ext = (strpos($extension, ',') !== false) ? explode(',', $extension) : (array)$extension;
00038 }
00039
00046 public function accept () {
00047 foreach ($this->_ext as $ext) {
00048 if (strpos((string)$this->current(), $ext) !== false)
00049 return true;
00050 }
00051 return false;
00052 }
00053 }