Answers for "php get all files of folder"

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
4

php get all php files in a directory

foreach(glob('includes/*.php') as $file) {
    ...
}
Posted by: Guest on March-21-2020

Code answers related to "php get all files of folder"

Browse Popular Code Answers by Language