PHP First Array


#1

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

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


#2

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

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

#3

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.


#4

Try using this syntax..short and easy to understand

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

same thing as

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

#5

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