Re: getting filenames from dir

From: Date: Sat, 02 Apr 2005 04:36:18 +0000
Subject: Re: getting filenames from dir
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-212072@lists.php.net to get a copy of this message
That should get you started : $dirname='/var'; $dh=opendir($dirname) or die('could not open directory'); while (!(($file=readdir($dh))===false)){ if (is_dir('$dirname/$file')){
       $myarray[]=$file;
} echo "$file<br>"; $myarray[]=$file; } Mario Merlin wrote:
Hi there, does anybody know how to get all file names from a specified directory into an array? Thanx, Merlin


« previous php.general (#212072) next »