This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Arrays Forum

View Course » View Exercise

859 points
521a27a4548c357f16002d93_429916944
Submitted by
Nian Bao Zou
over 3 years ago

1.2 Array Syntaxs - Answer

my code:

Woot, More Arrays!



<?php
$items = array("Chips", "Sausage","kk","one","two" );

$array = array("Egg", "Tomato", "Beans" );

?>


4 votes

permalink

It's correct :)

<html>
  <head>
    <title>Woot, More Arrays!</title>
  </head>
  <body>
    <p>
      <?php
        // Add your array elements after
        // "Beans" and before the final ")"
        $array = array("Egg", "Tomato", "Chips", "Sausage", "Beans" );        
      ?>
    </p>
  </body>
</html>

820 points
530849a37c82cac191001193_728735541
Submitted by
ByJacob Button
about 3 years ago


1 vote

permalink

If I read the instructions correctly, it's asking you to add "3" items to the array they have created. That would mean that instead of creating a whole new array, like you did, you just have to add 3 new elements to the array that has been created for you.

That should solve your problem.

132 points
52485373abf821d3b1003c50_483962041
Submitted by
Brian
over 3 years ago

1 Comment

55347c0151b88714730006df_867028172 Gabriel Tseng over 3 years ago

2 items


0 votes

permalink

Ok,which error do you have?You wrote 2 lines of array code,but you didn't say which type of error,do you have?

272 points
5631023ad3292fc57400021a_214964193
Submitted by
Roman Ina
over 3 years ago

1 Comment

521a27a4548c357f16002d93_429916944 Nian Bao Zou over 3 years ago

NO