Search
 
SCRIPT & CODE EXAMPLE
 

PHP

count files in folder php

// You can get the filecount like so:
$directory = "/path/to/dir/";
$filecount = 0;
$files = glob($directory . "*");
if ($files){
 $filecount = count($files);
}
echo "There were $filecount files";
// where the "*" is you can change that to a specific filetype if you want like "*.jpg" or you could do multiple filetypes like this:
// the GLOB_BRACE flag expands {a,b,c} to match 'a', 'b', or 'c'
// glob($directory . "*.{jpg,png,gif}",GLOB_BRACE);
Comment

PREVIOUS NEXT
Code Example
Php :: check empty laravel blade 
Php :: laravel ide-helper 
Php :: symfony convert entity to array 
Php :: drupal 9 enable PHP errors 
Php :: how to print all session variables in php 
Php :: php array continued 
Php :: Error: php@7.2 has been disabled because it is deprecated upstream! 
Php :: php redirect to page 
Php :: for i php 
Php :: php number to word 
Php :: php load specific post id on language 
Php :: php convert date string to number 
Php :: wp_query item count 
Php :: php force image refresh 
Php :: vue mouseover 
Php :: laravel active nav 
Php :: php remove everything after a specific character 
Php :: laravel clear cache 
Php :: causes of 419 error lravel 
Php :: wp display custom fields 
Php :: How to add new column in table laravel 
Php :: php subtract seconds from datetime 
Php :: PHP Deprecated: Function create_function() 
Php :: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 67108872 bytes) in phar:///usr/local/bin/composer1.phar/src/Composer/DependencyResolver/RuleSet.php on line 8 
Php :: php artisan cache:clear Failed to clear cache. Make sure you have the appropiate permissions 
Php :: include and require in php 
Php :: convert a php array into a javascript array 
Php :: laravel migration change default value 
Php :: how to take last entry in database in laravel Method ONe 
Php :: remove first element in array php 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =