How to count number of files in directory PHP?By Hardik Savani | March 14, 2016 | | 2927 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);
- Laravel 5 - Dynamic Dependant Select Box using JQuery Ajax Example - Part 1
- How to get Ip Address in Laravel 5?
- How to check if View Exists or not in Laravel 5?
- How to check column exists or not in table Laravel 5
- Bootstrap - maxlength validation with count remaining character example
- Laravel 5 - Image Gallery CRUD example from scratch
- How to get current page url in PHP?
- Laravel 5 create custom artisan command with example