Tips, Tricks and Tools
... and Thoughts
(Move to ...)
Home
All Posts
Firefox Extensions
JavaScript Compiler and Encoder
Bulk Player for YouTube
Misc Tools
Support
▼
Monday, September 23, 2019
PHP: list all files and sub-directories under the current directory
Create a file index.php:
<?php
$allItems = scandir(".");
$toHide = array('.', '..', 'index.php');
$toShow = array_diff($allItems, $toHide);
foreach ($toShow as $oneItem) {
echo "<a href='$oneItem'>$oneItem</a><br>";
}
?>
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment