How to count number of files in directory PHP?By Hardik Savani | March 14, 2016 | | 1686 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);
- Fixed - MassAssignmentException in model.php laravel 5?
- Laravel where clause with date_format() example
- How to create a text file for JSON and file download in Laravel 5?
- Jquery select2 ajax autocomplete example with demo in PHP
- PHP - import excel file into mysql database tutorial
- How to change app version code in Ionic framework
- PHP - Capture screenshot of website from URL example
- How to resolve - tokenmismatchexception in verifycsrftoken.php Laravel 5 Ajax ?