This forum is now read-only. Please use our new forums! Go to forums
Help! Section 4/7 isn't working
The assignment is to “Use echo to output the third item in $tens.” Below is my code. Why isn’t it working?!
$tens = array(10, 20, 30, 40, 50);
echo $tens[40]
Guys, please help, I really want to continue this course :(
Answer 55cf43d09376768d840004f8
Answer 55d053239113cbdc740004d5
0 votes
Hi Jason, tnx for the answer! During the brief moment that the PHP course was functioning (“Trying in 2 seconds” error), I put in $tens[3]. It didn’t work. It was only untill I put in $tens[2] that I could continue. To me, this makes no logical sense. The fourth element should either be 3 or 40, right? Why 2?!
Answer 55f880b7937676067400054b
0 votes
use echo $tens{2}; using the square brackets is not working in this exercise, most likely a typo in the correction engine
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency
2 comments
They asked you the third element, not the fourth.. So $tens[2] is correct..
use echo $tens{2}; using the square brackets is not working in this exercise, most likely a typo in the correction engine