Page 1 of 1

array indexing -1 works but +1 doesnt

Posted: Wed Jul 29, 2009 2:33 am
by gth759k
This is driving me nuts!

I have an array of photo ids and if I echo $thisphoto[$i-1]; it spits out the correct photo id; I have other code that handles that, but when I echo $thisphoto[$i+1]; it spits out nothing at all. So I tried echo $thisphoto[0]; and no surprise, it spit our the right number, but then I tried echo $thisphoto[1]; and nothing. echo count($thisphoto); spits out 7 so I don't see what the problem is. Any help would be appreciated. Thanks.

Re: array indexing -1 works but +1 doesnt

Posted: Wed Jul 29, 2009 2:48 am
by gth759k
Never mind, I figured it out. My bad.