note 108714 modified in function.scandir by danbrown
| From: | danbrown@php.net | Date: | Mon, 21 May 2012 16:10:45 +0000 |
| Subject: | note 108714 modified in function.scandir by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-188118@lists.php.net to get a copy of this message | ||
recursive file tree with structor,
cheers! <?php function rScan($dir){
	$list = array(); $items =
preg_grep($this->iRegex,scandir($dir)); foreach($items as
$item){ 	if(is_file("$dir/$item")){
		$list[] = $item; 		continue;
	} 	$list[$item] =
$rrScan("$dir/$item"); 	} 	return
$list; } ?>
--was--
function rScan($dir){
$list = array();
$items = preg_grep($this->iRegex,scandir($dir));
foreach($items as $item){
if(is_file("$dir/$item")){
$list[] = $item;
continue;
}
$list[$item] = $rrScan("$dir/$item");
}
return $list;
}
//recursive file tree with structor, cheers!
http://php.net/manual/en/function.scandir.php