1. Go to this page and download the library: Download kiwilan/php-filelist library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kiwilan / php-filelist example snippets
$list = FileList::make('/path/to/scan')->run();
$list->getFiles(); // List of files as `string[]`
$list->getSplFiles(); // List of SplFileInfo as `SplFileInfo[]`
$list->getErrors(); // List of errors as `string[]|null`
$list->getTimeElapsed(); // Time elapsed in seconds as `float`
$list->getTotal(); // Total files as `int`
$list->isSuccess(); // Success status as `bool`