Answer on Question #38200
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8"/>
<title>while loop</title>
</head>
<body>
<p>Fahrenheit to celcius</p>
[tbl-0.html](tbl-0.html)
<p>Celcius to fahrenheit</p>
<table border="1px" cellspacing="0px">
<tr><td>C</td><td>F</td></tr>
<?php
$c = 0;
while ($c != 101) {
echo "<tr><td>$c</td>";
$f = $c * 9 / 5 + 32;
echo "<td>" . round($f, 1) . "</td></tr>";
$c = $c + 1;
}
?>
</table>
</body>
</html>
Comments