As yous may be aware, as of PHP 5.4 there is built in server available. However, if you browse to directory with no \"index\" file, instead if listing all available files/di
For show advanced list of files and directories with sort, date, size, icon type,..., Save bellow content code as route.php
file, and then run this command:
php -S localhost:8080 -t . route.php
And then open http://localhost:8080/
in the browser.
Code:
$f,'date'=>filemtime($path.$f),'url'=>'index.php?dir='.rawurlencode(trim("$dir/$f",'/')));
else$files[]=array('name'=>$f,'size'=>filesize($path.$f),'date'=>filemtime($path.$f),'url'=>trim("$dir/".rawurlencode($f),'/'));
}
closedir($h);
$current_dir_name = basename($dir);
$up_dir=dirname($dir);
$up_url=($up_dir!=''&&$up_dir!='.')?'index.php?dir='.rawurlencode($up_dir):'index.php';
// END PHP ?>
=$current_dir_name==''?'Directory list':$current_dir_name?>
Preview:
gist