<?php
//Display the current filename:
# echo "This filename is: " . basename(__FILE__) . "<br /><br />";
//Use "glob" to collect filenames in a directory and display them:
//Single File extension:
foreach(glob("*.pdf") as $file) {
echo "<a href='" . $file . "' target='_blank'>" . $file . "</a><br />";
}
//Multiple file extensions:
foreach (glob("{*.pdf,*.jpg,*.txt,*.mp4,*.zip}",GLOB_BRACE ) as $file) {
echo "<a href='" . $file . "' target='_blank'>" . $file . "</a><br />";
}
//Multiple file extensions on AIX:
foreach (array_merge(glob("*.pdf"),glob("*.jpg"),glob("*.txt")) as $file) {
echo "<a href='" . $file . "' target='_blank'>" . $file . "</a><br />";
}
?>
Build seven good object-oriented habits in PHP.pdf
Build seven good object-oriented habits in PHP.pdf
readtextperline.txt
Build seven good object-oriented habits in PHP.pdf
readtextperline.txt