it=$it; $this->ext=$ext; } function accept() { $ext=pathinfo($this->current(),PATHINFO_EXTENSION); return ($ext==$this->ext) ? true : false; } } $d=new F_FileIterator(new DirectoryIterator('.'), 'php'); foreach ($d as $v) { echo "$v
\n"; } ?>