imperium2335 Posted April 3, 2009 Share Posted April 3, 2009 Hi quick question. When This script runs it always counts 1 extra but there are only say 3 files in the dir but it counts 4, any ideas? Thanks. $openzone = opendir("php/image-submission") ; while($file=readdir($openzone)) { if($file != '.' && $file != '..') { $filecount++ ; } } echo "$filecount" ; Quote Link to comment https://forums.phpfreaks.com/topic/152343-solved-file-count/ Share on other sites More sharing options...
imperium2335 Posted April 3, 2009 Author Share Posted April 3, 2009 Sorry, dreaweaver makes a hidden directory called notes. So now my questions changes: How do I make it so it doesnt count sub directorys? Cheers. Quote Link to comment https://forums.phpfreaks.com/topic/152343-solved-file-count/#findComment-800078 Share on other sites More sharing options...
PFMaBiSmAd Posted April 3, 2009 Share Posted April 3, 2009 http://us3.php.net/is_file Quote Link to comment https://forums.phpfreaks.com/topic/152343-solved-file-count/#findComment-800085 Share on other sites More sharing options...
imperium2335 Posted April 3, 2009 Author Share Posted April 3, 2009 Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/152343-solved-file-count/#findComment-800106 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.