How to count number of files in directory PHP?By Hardik Savani | March 14, 2016 | | 1132 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);
- How to upgrade node.js version in Ubuntu?
- How to create custom helper in Laravel 5?
- How to implement Email Verification with Activation Code example from Scratch in Laravel 5.2 ?
- How to do remember me function at login option in laravel 5?
- Laravel 5.4 New Feature - Add new Components & Slots in Blade Template
- How to get location information from ip address in Laravel ?
- Laravel 5 Localization(trans helper) tutorial example
- How to get ckeditor value with tags on ajax-submit ?