note 23390 added to function.readdir

From: Date: Wed, 17 Jul 2002 10:49:55 +0000
Subject: note 23390 added to function.readdir
Groups: php.notes 
Request: Send a blank email to php-notes+get-33201@lists.php.net to get a copy of this message
A little addition to the posting that used "find" to get a dir listing. It can easily be incorporated with grep to get filenames ending with only... say jpg. $dir="/directory/"; $a = find $dir -depth -type f -print | grep ".jpg$"; $files = explode ("\n", $a); As in the regexp example above the $ in ".jpg$" makes sure no .jpg.blaa extensions are showed. This works wonders for me :) -- http://www.php.net/manual/en/function.readdir.php http://master.php.net/manage/user-notes.php?action=edit+23390 http://master.php.net/manage/user-notes.php?action=delete+23390 http://master.php.net/manage/user-notes.php?action=reject+23390

« previous php.notes (#33201) next »