Tag : glob


How to count number of files in directory 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. <strong class="example"></strong> <pre class="prettyprint lang-php"> $folderPath = "upload/"; $countFile = 0; $totalFiles = glob($folderPath . "*"); if ($totalFiles){ $countFile = count($totalFiles); } print_r($countFile); </pre>

By Hardik Savani | March 14, 2016 | | 1353 Viewer | Category : PHP
READ MORE

    How to add ckeditor with image upload in Laravel ?

    How to add ckeditor with image upload in Laravel ?

    Open Post

    Laravel 5.3 - Create Bootstrap Contact US Form using Form Request

    Laravel 5.3 - Create Bootstrap Contact US Form using Form Request

    Open Post

    Laravel 5.3 Image Upload with Validation example

    Laravel 5.3 Image Upload with Validation example

    Open Post

    PHP AngularJS CRUD with Search and Pagination Example From Scratch

    PHP AngularJS CRUD with Search and Pagination Example From Scratch

    Open Post

    PHP - How to Convert file(image, audio, video) extension using CloudConvert API?

    PHP - How to Convert file(image, audio, video) extension using CloudConvert API?

    Open Post

    Laravel 5 - Paypal Payment Integration example using netshell/paypal package from scratch

    Laravel 5 - Paypal Payment Integration example using netshell/paypal package from scratch

    Open Post