Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialNelson Tinashe Gwarare
694 PointsOn PHP Basic challenge number 7, the code: eco $colors[1] is not being accepted, l can not progress
The question wants me to echo the second value in an array of three color values
3 Answers
Kevin D
8,646 PointsNot sure why it isn't working for you, I've done the same thing as you and got to pass. Maybe try copying and pasting this code and see if anything happens:
<?php
$integer_one = 1;
$integer_two = 2;
$golden = 1.618;
$bool = true;
$colors = ['red','blue','green'];
echo $colors[1];
?>
Nelson Tinashe Gwarare
694 Pointsthanks, l think l had added a (var_dump ) and that may have been the cause for failure to read.
Raksa Meth
1,018 PointsIt's seem you write eco instead of echo :)
Nelson Tinashe Gwarare
694 Pointssorry its actually a mistake on typing in the question, its refusing: echo $colors[1]
Daniel Baker
3,198 PointsI was in the same boat and could not progress using "echo $colors[1];". I deleted the var_dump and it passed just fine.
Nelson Tinashe Gwarare
694 PointsNelson Tinashe Gwarare
694 PointsCorrection
........ echo colors[1] is not being accepted