note 39231 added to ref.dir

From: Date: Wed, 21 Jan 2004 15:12:15 +0000
Subject: note 39231 added to ref.dir
Groups: php.notes 
Request: Send a blank email to php-notes+get-63955@lists.php.net to get a copy of this message
I couldnt get the function by sc1n at yahoo dot com to work, so I modded it minorly to this: function Fetch_File_Tree($start_directory) { if( $dir = @opendir($start_directory) ) { $tree = array(); while( FALSE !== ($file = readdir($dir)) ) { if($file != "." && $file != "..") { $absolute_file = $start_directory . $file; if (is_file($absolute_file)) $tree[] = $file; else if (is_dir($absolute_file)) Fetch_File_Tree($absolute_file."/"); } } } else { return FALSE; } return $tree; } The @-sign is just for suppressing warnings. Good luck! ---- Manual Page -- http://www.php.net/manual/en/ref.dir.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+39231 Delete -- http://master.php.net/manage/user-notes.php?action=delete+39231&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+39231&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#63955) next »