Answers for "how to echo all the files in a directory php"

PHP
9

list all files in directory php

$path    = './';
$files = scandir($path);
$files = array_diff(scandir($path), array('.', '..'));
foreach($files as $file){
  echo "<a href='$file'>$file</a>";
}
Posted by: Guest on November-05-2020

Code answers related to "how to echo all the files in a directory php"

Browse Popular Code Answers by Language