How to count number of files in directory PHP?By Hardik Savani | March 14, 2016 | | 998 Viewer | Category : PHP
Share this post:
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);
- Solved - Access Not Configured. Google+ API (truncated...) on google console developer
- Laravel 5 export to pdf using maatwebsite example
- How to Uninstall a Package in Laravel 5 Using Composer Command?
- PHP download file from url using curl example
- How to get user agent value in Laravel 5?
- Dynamic Autocomplete search using Bootstrap Typeahead JS Example
- HTML/FORM not found in Laravel 5?
- How to create Event for Mail sending in Laravel 5.2?