Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #13496

Re: count() problem

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!not-for-mail
From "M. Strobel" <sorry_no_mail_here@nowhere.dee>
Newsgroups comp.lang.php
Subject Re: count() problem
Date Sat, 03 May 2014 20:36:14 +0200
Lines 28
Message-ID <bskr8uFbqvlU1@mid.uni-berlin.de> (permalink)
References <gpqyx6uagdlf$.10osd5vpnl4mw.dlg@40tude.net>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de npk8AoMiJEF2bSpAgThTfg0I7/JUmENTSK3/6SPM+HIY39wBg=
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0
In-Reply-To <gpqyx6uagdlf$.10osd5vpnl4mw.dlg@40tude.net>
Xref csiph.com comp.lang.php:13496

Show key headers only | View raw


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.

Back to comp.lang.php | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

count() problem richard <noreply@example.com> - 2014-05-03 14:18 -0400
  Re: count() problem "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2014-05-03 20:32 +0200
    Re: count() problem richard <noreply@example.com> - 2014-05-03 15:57 -0400
      Re: count() problem Denis McMahon <denismfmcmahon@gmail.com> - 2014-05-03 22:14 +0000
  Re: count() problem Richard Yates <richard@yatesguitar.com> - 2014-05-03 11:33 -0700
  Re: count() problem "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2014-05-03 20:36 +0200

csiph-web