note 59812 deleted from function.readdir by tularis
| From: | tularis@php.net | Date: | Sun, 13 May 2007 19:01:55 +0000 |
| Subject: | note 59812 deleted from function.readdir by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-126520@lists.php.net to get a copy of this message | ||
Note Submitter: doom at inet dot ua
----
How i make my directory tree for print (you can make array)
<?php
$First_Dir = "./my_big_dir";
read_dir($First_Dir);
/**** functions part ****/
function read_dir($name_subdir)
{
$dh = opendir($name_subdir);
while(gettype($file = readdir($dh))!=boolean)
{
if ($file != '..')
if ($file != '.')
{
$current_element = $name_subdir."/".$file;
if(is_dir($current_element))
{
echo $current_element."<br>";
read_dir($current_element);
}
}
}
closedir($dh);
}
?>
Best free :-)