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


#1







<?php
$friends = ("Riley", "Jr.", "Chase",)
?>



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


#2

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.


#3

Remove the last comma. :slightly_smiling:


#4

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


#5

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