Blockquote
$d = dir(“.”);
$dd = array();
while (false !== ($entry = $d->read())) {
if(‘.’ !== $entry && ‘…’ !== $entry) {
if( is_dir($entry)){
$dd[ ]= $entry;
}
}
}
$d->close();
print_r($dd);
The code above produces the result below.
Blockquote
Array ( [0] => dir1 [1] => dir2 )
I like to produce my target result below, dir names only.
Blockquote
dir1 dir2
and I like to use “echo” instead of “print_r” with your help.