File count in a web dir?

7 posts Page 1 of 1
Contributors
User avatar
Esky
VIP - Donator
VIP - Donator
Posts: 86
Joined: Tue Dec 22, 2009 11:36 am

File count in a web dir?
Esky
How do i see how many files there are in a folder on my website, in html/php - not using the default index page thing...?? can anyone help
Current Project: Server Browser - Beta & Text based MMORPG
Image
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4392
Joined: Tue Aug 04, 2009 1:47 am

Re: File count in a web dir?
CodenStuff
Hello,

Do you mean count how many files in a folder?.
Code: Select all
<?php
$NOF=count(glob("*.*"));
echo "I counted ".$NOF.' Files in this folder';
?>
Hope that helps cooll;
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
Usman55
VIP - Site Partner
VIP - Site Partner
Posts: 2821
Joined: Thu Dec 24, 2009 7:52 pm

Re: File count in a web dir?
Usman55
Hello Codenstuff!

I think this is the thing that he asked! Again, I learnt a new thing!

Thanks!
Image
User avatar
Esky
VIP - Donator
VIP - Donator
Posts: 86
Joined: Tue Dec 22, 2009 11:36 am

Re: File count in a web dir?
Esky
Thanks so much! thats exactly what i need
Current Project: Server Browser - Beta & Text based MMORPG
Image
Lewis
Coding God
Coding God
Posts: 1564
Joined: Sun Dec 20, 2009 2:12 pm

Re: File count in a web dir?
Lewis
Thats me learning something new :D
And it helped me with my programn beleve it or not :D
Image
User avatar
DreadNought
VIP - Donator
VIP - Donator
Posts: 116
Joined: Fri Jan 08, 2010 12:37 pm

Re: File count in a web dir?
DreadNought
<?php
$NOF=count(glob("*.*"));
echo "I counted ".$NOF.' Files in this folder';
?>

were does the file dir go ?
Bound and boom tech,
The Future Of Coding
User avatar
rocky4126
VIP - Donator
VIP - Donator
Posts: 258
Joined: Mon Nov 16, 2009 7:39 pm

Re: File count in a web dir?
rocky4126
paralyzer wrote:
<?php
$NOF=count(glob("*.*"));
echo "I counted ".$NOF.' Files in this folder';
?>

were does the file dir go ?
The folder would go where *.* is (in the quotes). I think that is right, ask lewis or codenstuff.

OFF TOPIC MESSAGE TO CnS:
CnS please check your inbox for my messages. It is important for my competition.

Thanks, John
Image
7 posts Page 1 of 1
Return to “Help & Support”