get_dir_glob();
echo ‘<HR>’;
function myscandir($path)
{
if(!is_dir($path)) return;
foreach(scandir($path) as $file)
{
if($file!=’.' && $file!=’..’)
{
$path2= $path.’/’.$file;
if(is_dir($path2))
{
echo $file;
myscandir($path2);
}else
{
echo $file.”;
}
}
}
}
myscandir($path);
echo ‘<HR>’;
function myglob($path)
{
$path_pattern = $path.’/*’;
foreach(glob($path_pattern) as $file)
{
if(is_dir($file))
{
echo $file;
myscandir($file);
}else
{
echo $file.”;
}
}
}
myglob($path);