HI I have put together a php script that rolls a dice 26 times and assigns each result in turn along with its roll number. What I want to do now is print the total roll value and the average roll value but as i'm new to php I dont know how to do this so any help would be greatly appreciated. This is what I have so far
<head>
<title>Dice Roll</title></head>
<body>
<?php
$rolls = 26;
$sides = 6;
$results = array_fill(1, $sides, 0);
for($i=1; $i<=$rolls; $i+=1)
{
$roll = rand(1, $sides);
$results[$roll] += 1;
}
print '<table><tr><th>Roll Number</th><th>Roll Value</th></tr>';
for($i=1; $i<=$sides; $i+=1)
{
printf('<tr><td>%d</td><td>%d</td></tr>', $i, $results[$i]);
}
print '</table>';
?>
</body>
</html>