PHP First Array


Figured it out. (Example would be less confusing if you weren't using array in both spots).

      $friends = friends("Joe", "Jason", "Kelby");


It should be..........................

>  <p>
>     <?php
>     $friends = array("Joe", "Jason", "Kelby");
>     ?>
>  </p>


Tried multiple different strings within the $friends array and was just met by the spinning gear every time.

Eventually came across the solution on the forum by adding a space at the end of the final string just before the closing bracket. Can it either be explained why you would need that space or why there is such a ridiculous bug still in here after 2 years since that "solution" was found.


Try using this syntax..short and easy to understand

$friends = ["Joe", "Jason", "Kelby"];

same thing as

$friends = array("Joe", "Jason", "Kelby");


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.