How to count number of files in directory PHP?By Hardik Savani | March 14, 2016 | | 3328 Viewer | Category : PHP
If you are working on code php and you require to count number of files, images, zip file, rar files, etc in the given folder path, then you can count using glob() and count() of php. So, let's see this bellow example and learn how it done.
$folderPath = "upload/";
$countFile = 0;
$totalFiles = glob($folderPath . "*");
$countFile = count($totalFiles);
- How to count number of files in directory PHP?
- Laravel 5 - Implementing datatables tutorial using yajra package
- How to get last record from MySQL table in Codeigniter?
- How to add prefix in each key of PHP Array?
- How to retrieve number of twitter followers count without authentication or api ?
- How to convert Object into Array in PHP?
- How to rename column name foreign key constraint in MySql Query?
- CRUD (Create Read Update Delete) Example in Laravel 5.2 from Scratch