list_directory_contents.php
<?php
function showDirs($dir){
$files = scandir($dir);
$skip = array('.','..','index.php');
//echo '<ol>';
foreach ($files as $file){
if (in_array($file,$skip)){
continue;
}
if (is_dir("$dir/$file")){
echo '<h3>'.$file.'</h3><ul>';
showDirs("$dir/$file");
echo '</ul>';
continue;
}
$name = explode('.',$file);
echo '<li><a href="index.php?view='.base64_encode("$dir/$file").'">'.$name[0].'</a></li>';
}//end foreach
//echo '</ol>';
}//end func
?>
Paul's Code Library
Categories
HomeAJAX
classes
database_functions
date_functions
file_functions
googlevideo_and_youtube_api
htaccess
image_functions
string_functions