I’m trying to have the $adjective array have a value that is from the $currentCount, but it’s giving me an error.
it says syntax error. Thanks!
$currentCount = [0, 0, 0, 0, 0, 0];
$adjectives=["a","b","c","d","e"];
echo "<h1> The $adjectives[$currentCount[0]] ";
>Solution :
You should wrap the PHP part in the string with {}. Try this
$currentCount = [0, 0, 0, 0, 0, 0];
$adjectives=["a","b","c","d","e"];
echo "<h1> The {$adjectives[$currentCount[0]]} ";