Directories only

<?php
$dirFiles=glob($myDir. '*', GLOB_BRACE);
$fileList='';
foreach($dirFiles as $dirFile){
$list=$list.$dirFile. '<br>';
}
echo $list;

The code above produces the result below.

I like to produces the result below.

https://www.php.net/glob

glob has a flag for ONLYDIR

and you don’t need GLOB_BRACE 'cos you’re not using braces.