Disclaimer: I did not write this code myself a friend gave it to me.
<?php
$handle = opendir(dirname(realpath(__FILE__)).'/AlgemeneVergaderingen/');
while($file = readdir($handle)){
if($file !== '.' && $file !== '..'){
echo '<p><a href="AlgemeneVergaderingen/' .$file.'">' .$file. '</a></p>';
}
}
?>
The point of this code is to loop inside a map and get all the files and echo them out IN THE ORDER that they are inside of the map.
The code does echo them but not in the correct order.
below 2 pictures to help visualize.