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" ; 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. 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 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! Link to comment https://forums.phpfreaks.com/topic/152343-solved-file-count/#findComment-800106 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.