keepAway Posted May 5, 2011 Share Posted May 5, 2011 How to count the number of files/images from a folder? Quote Link to comment https://forums.phpfreaks.com/topic/235624-count-number-of-files/ Share on other sites More sharing options...
Maq Posted May 5, 2011 Share Posted May 5, 2011 Check out the glob function. Quote Link to comment https://forums.phpfreaks.com/topic/235624-count-number-of-files/#findComment-1211041 Share on other sites More sharing options...
perky416 Posted May 5, 2011 Share Posted May 5, 2011 $dir_path = "/full/directory/path/"; $count = count(glob($dir_path . "*")); I believe you can replace the * with your file extensions if you only want to search for particular files. Quote Link to comment https://forums.phpfreaks.com/topic/235624-count-number-of-files/#findComment-1211042 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.