PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
ozzy
Forum Commoner
Posts: 74 Joined: Tue Apr 11, 2006 4:45 pm
Post
by ozzy » Fri Apr 28, 2006 10:47 am
Hey, i think im in love with glob, it works with so many things. But i ahve a question, how would i count the files which have been displayed through glob.
I tryed
Code: Select all
$numberoffiles = count(glob("$files"));
or
Code: Select all
$numberoffiles = count(glob("$path"));
But it didnt seem to work, and the output is 1111111111 or 0000000000. Does anyone know why or where im going wrong?
Thanks in advance!
LOVE YOU <3
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Fri Apr 28, 2006 11:04 am
That would depend on what $path and $files are. You have the correct syntax, if they are set correctly.
ozzy
Forum Commoner
Posts: 74 Joined: Tue Apr 11, 2006 4:45 pm
Post
by ozzy » Fri Apr 28, 2006 12:10 pm
My current $files is:
Code: Select all
$files = glob($dir . 'vuns/files/*');
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Fri Apr 28, 2006 12:20 pm
just
count($files) would work then.
ozzy
Forum Commoner
Posts: 74 Joined: Tue Apr 11, 2006 4:45 pm
Post
by ozzy » Fri Apr 28, 2006 12:51 pm
But then it returns as just the number '0', dispite me having over 100 files.