How to count number of files in directory PHP?By Hardik Savani | March 14, 2016 | | 2117 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);
- Laravel guzzle http client POST request example
- Laravel 5 generate sitemap using roumen/sitemap package Example
- How to calculate age from date of birth column in mysql?
- Laravel 5 - Paypal Payment Integration example using netshell/paypal package from scratch
- AngularJS - update bind ng-model input value from Jquery Code
- PHP Script - Login with Facebook using facebook-php-sdk and MySQL example with demo
- Solved Issue - "/usr/bin/env: ‘node’: No such file or directory"
- Codeigniter 3 - select2 ajax autocomplete from database example with demo