PHP Listing all folder and subfolders

Listing all folder and subfolders

<?
function davai($dir) {
  $handle = opendir($dir);
  while ($file = readdir($handle))
    if ($file != "." && $file != "..")
      if (is_file("$dir/$file")) echo "$dir/$file<br>";
      else davai("$dir/$file");
}
davai("music");
?>