In the next code snippet, I show you how to only show .html files from a specific directory. Here is that PHP code:
//path to directory to scan
$directory = "uploads/";
//get all files files with a .html extension.
$files = glob($directory . "*.html");
//print each file name
foreach($files as $filename)
{
echo $filename;
echo "<br>";
}
//path to directory to scan
$directory = "uploads/";
//get all files files with a .html extension.
$files = glob($directory . "*.html");
//print each file name
foreach($files as $filename)
{
echo $filename;
echo "<br>";
}
0 comments:
Post a Comment