Easy PHP localhost landing page
Always making tedious work adding side-projects to your root web directory on WAMP/LAMP/MAMP?
Just use this handy index.php
file:
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>localhost</title>
</head>
<body>
<h1>It Works!</h1>
<ul>
<?php
$dirs = array_filter(glob('*'), 'is_dir');
foreach ($dirs as $key => $value) {
echo('<li><a href="'.$value.'">'.$value.'</a></li>');
}
?>
<!-- I have my phpMyAdmin located somewhere else -->
<li><a href="phpmyadmin">phpmyadmin</a></li>
</ul>
</body>
</html>
Written by Justin Derby
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#