- opendir: documentation ( source)
- closedir: documentation ( source)
- readdir: documentation ( source)
- is_dir: documentation ( source)
<?php
function ls($path = '.')
{
$d = opendir($path);
while ($file = readdir($d))
{
if (!in_array($file, array(".", "..")) && is_dir(($path == '.' ? "/" : $path."/").$file))
ls(($path == '.' ? "/" : $path."/").$file);
echo $path."/".$file."\n";
}
closedir($d);
}
ls();