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

Arrays Forum

View Course

801 points
1cb0fcfe872e54824e2f5d43863d193a?s=140&d=retro
Submitted by
BirdM.
almost 2 years ago

error on lesson 5/7

here's my code. I have literally no idea what's wrong, i changed it to the {}'s.

Accessing Elements



<?php
$tens = array(10, 20, 30, 40, 50);
echo $tens{4};
?>

thanks!


0 votes

permalink

try this

<?php
$tens= array(10, 20, 30, 40, 50);
print $tens{2};
?>

218 points
37cb3a28e639c28c6df2fcbd416452be?s=140&d=retro
Submitted by
fabiokings2
almost 2 years ago

1 Comment

1cb0fcfe872e54824e2f5d43863d193a?s=140&d=retro BirdM. almost 2 years ago

thank you so much! I didn't know to change it to 2! :)