Web lists-archives.com

Re: [PHP] Re: I am stumped




> On Apr 29, 2018, at 2:39 AM, Christoph M. Becker <cmbecker69@xxxxxx> 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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php