You can simply do the following :
$fi = new FilesystemIterator(__DIR__, FilesystemIterator::SKIP_DOTS);
printf("There were %d Files", iterator_count($fi));
More Related Contents:
- Getting the names of all files in a directory with PHP
- PHP list of specific files in a directory
- PHP list all files in directory [duplicate]
- Deleting all files from a folder using PHP?
- How to delete a folder with contents using PHP [duplicate]
- Get the hierarchy of a directory with PHP
- Adding files cookies PHP (host)
- How do I add PHP code/file to HTML(.html) files?
- How can one check to see if a remote file exists using PHP?
- How to get count of rows in MySQL table using PHP?
- How to delete a line from the file with php?
- PHP, get file name without file extension
- List all files in one directory PHP [duplicate]
- Get the current script file name
- PHP – Move a file into a different folder on the server
- php creating zips without path to files inside the zip
- How to run array_filter recursively in a PHP array?
- PHP: Force file download and IE, yet again
- Laravel 5.3 multiple file uploads
- PHP recursive directory path
- overriding upload_max_filesize
- Create new XML file and write data to it?
- PHP – count specific array values
- move all files in a folder to another?
- PHP – Listing all directories and sub-directories recursively in drop down menu [duplicate]
- Read and write to a file while keeping lock
- Is this the most efficient way to get and remove first line in file?
- How download big file using PHP (low memory usage)
- Sort directory files by creation datetime in Windows filesystem
- mysql count into PHP variable