Answers for "php get file list in folder"

PHP
7

php get file contents

<?php
file_get_contents("file.txt");
?>
Posted by: Guest on May-12-2020
4

php get all php files in a directory

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

php list all files in directory

scandir ( string $directory [, int $sorting_order = SCANDIR_SORT_ASCENDING [, resource $context ]] ) : array
Posted by: Guest on April-23-2020

Browse Popular Code Answers by Language