note 39774 added to ref.dir

From: Date: Tue, 10 Feb 2004 12:21:35 +0000
Subject: note 39774 added to ref.dir
Groups: php.notes 
Request: Send a blank email to php-notes+get-64946@lists.php.net to get a copy of this message
I searched around and couldn't find a decent function that JUST returned directories, not files. I couldn't get the ones here to work so i wrote my own. <?php function read_dir($path){ static $dir_arr = array () ; $handle=opendir($path); while ($file = readdir($handle)) { if ($file != "." && $file != ".." && is_dir($path.$file)) { $sub_dir = $path . $file . "/" ; $dir_arr[] = $sub_dir ; read_dir($sub_dir); } } return $dir_arr ; } ?> ---- Manual Page -- http://www.php.net/manual/en/ref.dir.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+39774 Delete -- http://master.php.net/manage/user-notes.php?action=delete+39774&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+39774&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#64946) next »