I know how to list files in a folder:
but I want to only list files with the extension $extension.
So right now I'm using this:
(getextension() is a function from vBulletin btw)
But I was wondering if there is an easy way to do this, straight from the dir class?
Thanks for any help.
Code:
$dir=dir("./$folder/."); while($filename=$dir->read()) { } $dir->close();
So right now I'm using this:
Code:
$dir=dir("./$folder/."); while($filename=$dir->read()) { if (getextension($filename)==$extension) { // Do the good stuff } } $dir->close();
But I was wondering if there is an easy way to do this, straight from the dir class?
Thanks for any help.
Comment