note 93081 added to function.opendir

From: Date: Sat, 22 Aug 2009 01:25:03 +0000
Subject: note 93081 added to function.opendir
Groups: php.notes 
Request: Send a blank email to php-notes+get-159776@lists.php.net to get a copy of this message
To exclude all files beginning with a dot, a simple regular expression match would do the job: $dir = "DIR/"; if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { if(preg_match('/^\./', $file )) { continue; } echo $file . "<br>"; } closedir($dh); } } ---- Server IP: 208.69.120.35 Probable Submitter: 76.101.190.113 ---- Manual Page -- http://www.php.net/manual/en/function.opendir.php Edit -- https://master.php.net/note/edit/93081 Del: integrated -- https://master.php.net/note/delete/93081/integrated Del: useless -- https://master.php.net/note/delete/93081/useless Del: bad code -- https://master.php.net/note/delete/93081/bad+code Del: spam -- https://master.php.net/note/delete/93081/spam Del: non-english -- https://master.php.net/note/delete/93081/non-english Del: in docs -- https://master.php.net/note/delete/93081/in+docs Del: other reasons-- https://master.php.net/note/delete/93081 Reject -- https://master.php.net/note/reject/93081 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#159776) next »