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

    Select box with search option example in Jquery using Chosen Plugin

    Select box with search option example in Jquery using Chosen Plugin

    Open Post

    AngularJS - convert comma separated string to array example

    AngularJS - convert comma separated string to array example

    Open Post

    Laravel 5 email verification with activation code example

    Laravel 5 email verification with activation code example

    Open Post

    How to create quick apache virtual host in Ubuntu?

    How to create quick apache virtual host in Ubuntu?

    Open Post

    How to create ban/revoke user functionality in Laravel 5 example ?

    How to create ban/revoke user functionality in Laravel 5 example ?

    Open Post

    Laravel 5 - Generate Captcha code and Validation example using BotDetect package

    Laravel 5 - Generate Captcha code and Validation example using BotDetect package

    Open Post