Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: "M. Strobel" Newsgroups: comp.lang.php Subject: Re: count() problem Date: Sat, 03 May 2014 20:32:56 +0200 Lines: 21 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de asgHhxg4fhPlaPp2CYvXHQFtOQR+2PNMpiMuzHNnuW6qs8h5U= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 In-Reply-To: Xref: csiph.com comp.lang.php:13494 Am 03.05.2014 20:18, schrieb richard: > > $dir = '../audio/'.$yr.'/'; > $files = scandir($dir); > $number=count(files); did you mean $number=count($files); ? /Str. > 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. >