note 82378 added to function.scandir

From: Date: Tue, 08 Apr 2008 20:51:50 +0000
Subject: note 82378 added to function.scandir
Groups: php.notes 
Request: Send a blank email to php-notes+get-138032@lists.php.net to get a copy of this message
I was looking for another way to hide "." and ".." folders and I have found the solution: <?php foreach (preg_grep('/[^\.]/', scandir('./')) as $file) { echo $file; } ?> And now there is no "dot" directories. Enjoy! ---- Server IP: 195.54.192.44 Probable Submitter: 127.0.0.1 ---- Manual Page -- http://www.php.net/manual/en/function.scandir.php Edit -- https://master.php.net/note/edit/82378 Del: integrated -- https://master.php.net/note/delete/82378/integrated Del: useless -- https://master.php.net/note/delete/82378/useless Del: bad code -- https://master.php.net/note/delete/82378/bad+code Del: spam -- https://master.php.net/note/delete/82378/spam Del: non-english -- https://master.php.net/note/delete/82378/non-english Del: in docs -- https://master.php.net/note/delete/82378/in+docs Del: other reasons-- https://master.php.net/note/delete/82378 Reject -- https://master.php.net/note/reject/82378 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#138032) next »