This forum is now read-only. Please use our new forums at

1936 points
Submitted by
over 5 years ago

Unset: Does index not start at 0?

Removing Python from the list required unset($languages[3]), though by index rules, shouldn't it be [2]? Maybe I missed something.

2 votes


the array is as following:
array("HTML/CSS", "JavaScript", "PHP", "Python", "Ruby")

So to remove Python is to unset($languages[3]), which is technically the FOURTH item in the array when counting normally. Maybe you missed the HTML/CSS array item?

692 points
Submitted by
over 5 years ago

1 Comment

51fb4880548c35db030019c3_164250221 Joel almost 5 years ago

That's what happened to me. It was on a separate line that I wasn't looking at. It took me a while to figure out. I came here to see if anyone else had the same problem! :)