note 81434 added to function.scandir

From: Date: Thu, 28 Feb 2008 08:10:12 +0000
Subject: note 81434 added to function.scandir
Groups: php.notes 
Request: Send a blank email to php-notes+get-136546@lists.php.net to get a copy of this message
The easiest and most efficient way to skip 'hidden' folders and the obtrusive '..' & '.' is like so foreach(scandir('.') as $f) { if ($f[0]=='.') continue; //Do your dirty work code monkey strings are arrays! } I haven't seen anyone use this simple solution so far so I thought I'd share it ---- Server IP: 66.207.199.35 Probable Submitter: 99.235.98.162 ---- Manual Page -- http://www.php.net/manual/en/function.scandir.php Edit -- https://master.php.net/note/edit/81434 Del: integrated -- https://master.php.net/note/delete/81434/integrated Del: useless -- https://master.php.net/note/delete/81434/useless Del: bad code -- https://master.php.net/note/delete/81434/bad+code Del: spam -- https://master.php.net/note/delete/81434/spam Del: non-english -- https://master.php.net/note/delete/81434/non-english Del: in docs -- https://master.php.net/note/delete/81434/in+docs Del: other reasons-- https://master.php.net/note/delete/81434 Reject -- https://master.php.net/note/reject/81434 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#136546) next »