Re: Re: I am stumped

From: Date: Sun, 29 Apr 2018 16:37:13 +0000
Subject: Re: Re: I am stumped
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-326454@lists.php.net to get a copy of this message
> On Apr 29, 2018, at 2:39 AM, Christoph M. Becker <cmbecker69@gmx.de> wrote: > > On 29.04.2018 at 06:16, Jeffry Killen wrote: > >> if(($_DR = scandir($_dir)) === false) > […] >> for($_itr = 1; $_itr < count($_DR); $_itr++) >> >> testBed is the directory being read for this >> Why is testBed/test_1 included and the value is 1 >> instead of 'directory'. At the bottom of the list is test_1 listed as a file. > > An array created by scandir() is indexed from 0 to count()-1. The first > two elements normally have the values '.' and '..', respectively. > You're starting from 1, so '.' is skipped, but '..' produces the > test_1 > in your case. > thanks for reply; O.K. I understand that but the switch block should be skipping . and .. anything that is not . or .. is handled in the default case. JK

« previous php.general (#326454) next »