note 105891 added to function.scandir

From: Date: Fri, 23 Sep 2011 15:37:02 +0000
Subject: note 105891 added to function.scandir
Groups: php.notes 
Request: Send a blank email to php-notes+get-183367@lists.php.net to get a copy of this message
A simple function to get paths to all files in the subdirectories of the mentioned directory. Works well for small projects function get_subdir_files($main_dir) { $dirs = scandir($main_dir); foreach($dirs as $dir) { if ($dir === '.' || $dir === '..') { continue; } $files=scandir($main_dir."/".$dir); foreach ($files as $file) { if ($file === '.' || $file === '..') { continue; } else { $result[]=$main_dir."/".$dir./".$file; } } } return $result; } ---- Server IP: 69.147.83.197 Probable Submitter: 92.49.26.233 ---- Manual Page -- http://www.php.net/manual/en/function.scandir.php Edit -- https://master.php.net/note/edit/105891 Del: integrated -- https://master.php.net/note/delete/105891/integrated Del: useless -- https://master.php.net/note/delete/105891/useless Del: bad code -- https://master.php.net/note/delete/105891/bad+code Del: spam -- https://master.php.net/note/delete/105891/spam Del: non-english -- https://master.php.net/note/delete/105891/non-english Del: in docs -- https://master.php.net/note/delete/105891/in+docs Del: other reasons-- https://master.php.net/note/delete/105891 Reject -- https://master.php.net/note/reject/105891 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#183367) next »