List All Files In Directory Php

[Solved] List All Files In Directory Php | Php - Code Explorer | yomemimo.com
Question : list all files in directory php

Answered by : realy-silly-shark

$path = './';
$files = scandir($path);
$files = array_diff(scandir($path), array('.', '..'));
foreach($files as $file){ echo "<a href='$file'>$file</a>";
}

Source : | Last Update : Thu, 12 Nov 20

Question : php get all php files in a directory

Answered by : lemonz

foreach(glob('includes/*.php') as $file) { ...
}

Source : | Last Update : Sat, 28 Mar 20

Question : require all files in directory php

Answered by : andrew-lautenbach

foreach (scandir(dirname(__FILE__)) as $filename) { $path = dirname(__FILE__) . '/' . $filename; if (is_file($path)) { require $path; }
}

Source : | Last Update : Thu, 09 Sep 21

Question : php list all files in directory

Answered by : calm-curlew-geyjf6fvmg61

scandir ( string $directory [, int $sorting_order = SCANDIR_SORT_ASCENDING [, resource $context ]] ) : array

Source : | Last Update : Thu, 30 Apr 20

Answers related to list all files in directory php

Code Explorer Popular Question For Php