php4ever Posted October 22, 2007 Share Posted October 22, 2007 Anyone have a simple function or snippet that can count files in a remote folder? ~ Jared Link to comment https://forums.phpfreaks.com/topic/74274-allow_url_fopen-question-2/ Share on other sites More sharing options...
JJohnsenDK Posted October 22, 2007 Share Posted October 22, 2007 try this out: <? $dir = '/path/to/directory/'; $filecount = 0; $d = dir($dir); while ($f = $d->read()) { if(($f!= ".") && ($f!= "..")) { if(!is_dir($f)) $filecount++; } } echo 'there are ',$filecount,' files in this folder'; ?> Link to comment https://forums.phpfreaks.com/topic/74274-allow_url_fopen-question-2/#findComment-375283 Share on other sites More sharing options...
enoyhs Posted October 22, 2007 Share Posted October 22, 2007 You can take a look at this: http://fijiwebdesign.com/content/view/83/77/ Link to comment https://forums.phpfreaks.com/topic/74274-allow_url_fopen-question-2/#findComment-375288 Share on other sites More sharing options...
php4ever Posted October 22, 2007 Author Share Posted October 22, 2007 Both good examples, thank you. ~ Jared Link to comment https://forums.phpfreaks.com/topic/74274-allow_url_fopen-question-2/#findComment-375552 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.