This forum is now read-only. Please use our new forums! Go to forums
What's wrong here?
My code won’t pass.
I get the following error message:
Oops, try again. Did you remember to use array() in your code?
I have clearly used array()
on line 6
<html>
<p>
<?php
// Create an array and push 5 elements on to it, then
// print the number of elements in your array to the screen
$fruit = array();
array_push($fruit, "Apple");
array_push($fruit, "Banana");
array_push($fruit, "Kiwi");
array_push($fruit, "Grapes");
array_push($fruit, "Oranges");
echo count($fruit);
?>
</p>
</html>
Answer 53daaca3631fe90bf00004da
Answer 543d494a9c4e9dd32e00029b
0 votes
You have to change : $fruit = array();
into : $fruit = array(‘’);
and you will pass
1 comments
melaniesazegar about 9 years
I did this and it worked. Then I tried it again without the ‘’ and that worked too for some reason. Maybe it’s a browser issue. Thanks for your help!
Answer 5529caab51b8877138000185
0 votes
Just backspace and replace a letter in the word ‘array’. worked for me after i reloaded the page thrice
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
1 comments
I actually think it’s my browser. I’m having lots of issues in chrome, switched to IE (which I hate) and it passes