I am trying to output all the .php files on my website to a page. I have managed to do it, to a certain extent.
I have managed to output all the files which are in my website directory. These include textfiles, image files, .php files, etc.
I just want the output to be .php files and for them to be hyper-linked.
This is currently my code:
<?php
$dir = '/home/website/allfiles';
$files = scandir($dir);
echo "<pre>";
print_r($files);
echo "</pre>";
?>
The code above just prints all the files (.txt, .jpeg, .php, etc) in a array listing.