function diceRoll ($numSides, $numDice
{
$rolls = array();
/*Rolls each die and stores it's value while also keeping a running
total of the rolls.*/
for ($i = 0; $i < $numDice; $i++)
{
$dieValue = rand(1, $numSides);
$rollTotal += $dieValue
Array_push$rolls, $dieValue);
}
//Adds the roll total to the final index.
Array_push$rolls, $rollTotal);
return $rolls
}