Skip to content

Instantly share code, notes, and snippets.

@robesris
Created May 18, 2010 00:10
Show Gist options
  • Save robesris/404416 to your computer and use it in GitHub Desktop.
Save robesris/404416 to your computer and use it in GitHub Desktop.
<?php
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
if (is_dir($file)) {
echo "<h1>$file</h1>";
$album = opendir($file);
while (false !== ($song = readdir($album))) {
$info = pathinfo($song);
if ($info['extension'] == "mp3" || $info['extension'] == "ogg") {
echo "<div>$song<audio controls='controls' src=\"$file/$song\">";
echo "</audio></div>";
}
}
}
}
}
closedir($handle);
}
?>
@robesris
Copy link
Author

Took out one line that had an unused variable assignment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment