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 trialDaniel Rowlands
Courses Plus Student 4,438 PointsNow using the $colors array, echo the scond value... Why is my answer wrong?
I have followed all steps necessary to complete this, but am unable to finish.
2 Answers
akshaythakur
Courses Plus Student 34,019 PointsHi,
This should be answer echo $colors[1]; In PHP array index start with "0" not "1".So if you want to access second values inside array then you have to specify array index "1".
Grace Kelly
33,990 PointsHi Daniel, could you please post your code so we can see what's up?? :)
Daniel Rowlands
Courses Plus Student 4,438 PointsUmm... I thought I had already, but anyways. I tried the same answer the day after and, it did work. It must have been my fault... Thank you anyways.
Daniel Rowlands
Courses Plus Student 4,438 PointsDaniel Rowlands
Courses Plus Student 4,438 PointsUnfortunately, that is what I previously had. It gave me this answer: "It looks like you are echoing the wrong thing, remember that arrays are 0 based..."