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

Arrays Forum

View Course » View Exercise

683 points
51518d3e8f002e3e5c001e6c_516962940
Submitted by
Trikyas
over 4 years ago

This my code :) hope it helps

Noticed this course is buggy you may need to Submit a couple of times to get any results:(


Accessing Elements



<?php
$tens = array(10, 20, 30, 40, 50);
echo $tens[2];
?>


1 vote

permalink

<?php
$tens = array(10, 20, 30, 40, 50);
echo $tens[2];
?>

703 points
53f6364a631fe968a80000c9_804808581
Submitted by
calebbradford
over 3 years ago


0 votes

permalink

code is ok, but I'm don't understand,why is [2]

768 points
Picture
Submitted by
Paula Krzaczek
over 4 years ago

2 Comments

00fb17b8ad75307fbc0e9ff25f284b81?s=140&d=retro Cristian over 4 years ago

Array elements start counting at 0 so the third element in array is echoe'ed with [2].

50204e05379bbc00020004f7_171985447 Nick Samuel about 4 years ago

Thanks, felt so stupid - for some reason thought because it started at 0 it needed to be 4 :S