Why wont my code display? I’m pretty sure I copied it down how the book said to do it.
Dice Roll <?php $FaceNamesSingular = array("ones", "two" , "three", "four", "five", "six"); $FaceNamesPlural = array("ones", "two" , "three", "four", "five", "six"); function CheckForDoubles($Die1, $Die2) { global $FaceNamesSingular; global $FaceNamesPlural; if ($Die1 == $Die2) // Doubles echo "The roll was double ", $FaceNamesPlural[$Die1-1], "."; if ($Die1 != $Die2) // Not Doubles echo "The roll was a ", $FaceNamesSingular[$Die1-1], "and a", $FaceNamesSingular[$Die2-1], ".
"; function DisplayScoreText($Score) { if ($Score == 2) echo "You rolled snake eyes!
"; if ($Score == 3) echo "You rolled a loose deuce!
"; if ($Score == 5) echo "You rolled a fever five!
"; if ($Score == 7) echo "You rolled a natural!
"; if ($Score == 9) echo "You rolled a nina!
"; if ($Score == 11) echo "You rolled a yo!
"; if ($Score == 12) echo "You rolled boxcars!
"; $Dice = array(); $Dice[0] = rand(1,6); $Dice[1] = rand(1,6); $Score = $Dice[0] + $Dice[1]; echo "
";
echo "The total score for the roll was
$Score.
";
CheckForDoubles($Dice[0], $Dice[1]);
DisplayScoreText($Score);
echo "
I keep getting this
Parse error: syntax error, unexpected $end in C:\Users\Ruben Mendez\Documents\Xamp\xampp\htdocs\myfiles\Chapter2\DiceRoll.php on line 54
That’s the the end of the code at the I need help