Skip to content

Instantly share code, notes, and snippets.

@rn0
Created April 28, 2009 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rn0/103087 to your computer and use it in GitHub Desktop.
Save rn0/103087 to your computer and use it in GitHub Desktop.
<?php
class BrokenDescrFilter extends FilterIterator {
public function __construct(Iterator $iterator) {
parent::__construct($iterator);
}
public function accept() {
$file = $this->getInnerIterator()->current();
if($file->getSize() == 18) {
return true;
}
return false;
}
}
$di = new DirectoryIterator('downloads/pronox/descr/');
$di = new BrokenDescrFilter($di);
echo '<pre>';
$i = 1;
foreach($di as $file) {
echo rtrim($file->getFileName(), '.xml') . ', ';
if($i % 20 == 0) {
echo "\n";
}
$i++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment