This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by Colmonkey
about 9 years

Is this a glitch? "Oops, try again. Did you remember to use array() in your code?"

After running my code, everything works, but I don’t advance to the next level, it says:

Oops, try again. Did you remember to use array() in your code?

Here is my code(everything works fine from what I can see):

<?php
// Create an array and push 5 elements on to it, then 
// print the number of elements in your array to the screen
$names = array();
array_push($names, "George");
array_push($names, "Frank");
array_push($names, "Andy");
array_push($names, "Morgan");
array_push($names, "Kate");
print count($names);

?>

Answer 5514066e51b8870dba001870

2 votes

Permalink

It seems to be a bug with the type of browser you are using, try switching from whatever browser you are using to a different one, if that doesn’t work I recommend looking at responses to your question in the Q&A section, I find the majority of my answers there even if I’m not the one asking the questions.

points
Submitted by Yeldur
about 9 years

Answer 551b14c19376769dc3000a58

1 vote

Permalink

I’m having the same problem. Help!

points
Submitted by HERObrine
almost 9 years

2 comments

athiyoka almost 9 years

print this after you writen your five points //print 5 next to print count

Shapnam Afshar almost 9 years

Try to refresh you page because I tryed it and it worked because i copied and pasted +Colmonkey code.

Answer 55748579e39efe040c000619

0 votes

Permalink

I’ve tried chrome, firefox and even internet explorer shudders. Which browser have people had luck with? I am not pc so no safari for me.

points
Submitted by Brigette Eckert
almost 9 years

Answer 560a9e29937676235d0001b2

0 votes

Permalink

I was having a problem like this, except my code was:

    <?php
    // Create an array and push 5 elements on to it, then 
// print the number of elements in your array to the screen
$friends = array();

array_push($friends, "Phlox");
array_push($friends, "Mathilde");
array_push($friends, "Eva");
array_push($friends, "Ellen");
array_push($friends, "Jos");

print count($friends);
    ?>

After I removed the empty line after $friends = array(); I passed the question. Maybe removing empty rules will help you guys too.

points
Submitted by SomeMountain
over 8 years