FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » count() problem
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: count() problem [message #185708 is a reply to message #185705] Sat, 03 May 2014 18:36 Go to previous message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma:
Senior Member
Am 03.05.2014 20:18, schrieb richard:
>
> $dir = '../audio/'.$yr.'/';
> $files = scandir($dir);
> $number=count(files);
> echo $number;
>
> Why does this always show the resutlt as 1?
>
>
> $dir = '../audio/'.$yr.'/';
> $files = scandir($dir);
> echo count(files);
>
> Shows the true count of the array.
>
And you still have turned error reporting off. How often have you been told to turn
it on?

php > echo count(files), "\n";
PHP Notice: Use of undefined constant files - assumed 'files' in php shell code on
line 1

Notice: Use of undefined constant files - assumed 'files' in php shell code on line 1
1
php >

/Str.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: scandir problem
Next Topic: how to join two arrays?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 16:47:10 GMT 2024

Total time taken to generate the page: 0.04213 seconds