Here’s the code
<?php
echo "<table border=\"0\">";
for ($d = 1; $d <= $times;$d++ )
{
echo "<tr><td>";
echo rand(1,6), "\n";
echo "</td></tr>";
}
echo "</table>"; ?>
I’m trying to get the max,min and sum of the rand(1,6), "\n";
But i can’t figure it out. And it’s killing me.
You need to collect the random numbers in an array, too:
Afterwards you can make use of
max,minandarray_sum(all these links come with nice examples).As your code already shows you should start to differ between code that does data-processing and code that does the HTML output: