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 | | 2071 Viewer | Category : PHP
READ MORE

    How to upload image with validation in PHP Codeigniter?

    How to upload image with validation in PHP Codeigniter?

    Open Post

    How to install laravel framework on windows xampp server from scratch?

    How to install laravel framework on windows xampp server from scratch?

    Open Post

    AngularJS - How to create read more/less toggle using Directive?

    AngularJS - How to create read more/less toggle using Directive?

    Open Post

    Jquery select2 ajax autocomplete example with demo in PHP

    Jquery select2 ajax autocomplete example with demo in PHP

    Open Post

    Laravel 5 Google OAuth authentication using Socialite Package

    Laravel 5 Google OAuth authentication using Socialite Package

    Open Post

    How to implement infinite ajax scroll pagination in Laravel 5?

    How to implement infinite ajax scroll pagination in Laravel 5?

    Open Post