php list folders within the current one

You can try this code

$d = dir(".");

echo "<ul>";

while (false !== ($entry = $d->read()))
{
    if (is_dir($entry) && ($entry != '.') && ($entry != '..'))
        echo "<li><a href='{$entry}'>{$entry}</a></li>";
}

echo "</ul>";

$d->close();

Lascia un commento

Il tuo indirizzo email non sarĂ  pubblicato. I campi obbligatori sono contrassegnati *