Creating your first array; What's wrong with my code?


$friends = ("Riley", "Jr.", "Chase",)

I followed the directions, but it told me my code was wrong. :confused::soccer: Please help!


In PHP there are two ways to declare an array.

The original version:

$myArray = array("bish", "bash", "bosh");

or (as of PHP 5.4) the shorthand version:

$myArray = ["bish", "bash", "bosh"];

If you're ever unsure of what version of PHP is being used, use the first example.


Remove the last comma. :slightly_smiling:


$friends = ("Riley", "Jr.", "Chase",)
above is my code it saying
that my code is wrong please help me out


$friends = array("Riley", "Jh", "Chase");
do like this