In a previous post I wrote about finding average of two or more numbers. I had done that in ASP.NET.
In that post I wrote, the original code I followed was in PHP.
Now I’m going to show the php page and the codes along with it.
$scores = array(65, 32, 78, 98, 66);
$total = 0;
foreach ($array as $value)
$total += $value;
echo “The total of number is :<br>” , $total , “<br>”;
if (count($array) > 0)
echo “The avarage is ” , “<h3>”, $total/count($array), “</h3>”;
Next it looks like: