Numbers
from 1 to 10
1
2
3
4
5
6
7
8
9
10
Dividing
integers by 10
1 / 10 = 0.1
2 / 10 = 0.2
3 / 10 = 0.3
4 / 10 = 0.4
5 / 10 = 0.5
6 / 10 = 0.6
7 / 10 = 0.7
8 / 10 = 0.8
9 / 10 = 0.9
10 / 10 = 1
Adding 5 to the
first 10 integers
1 + 5 = 6
2 + 5 = 7
3 + 5 = 8
4 + 5 = 9
5 + 5 = 10
6 + 5 = 11
7 + 5 = 12
8 + 5 = 13
9 + 5 = 14
10 + 5 = 15
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Intro to PHP</title>
<link href="phpindex.css" rel="stylesheet" type="text/css" />
</head>


<body>

<div id="container" class="seventyopacity">

<div id="head">
<h1>INTRODUCTION TO PHP - WEEK 2</h1>
</div>

<div id="navtop">
<ul>
<li><a href="http://www.srcfarm.com/lvsclasses.html">Home</a></li>
<li><a href="http://www.srcfarm.com/lvsclasses/php/phpindex.php">PHP Home</a></li>
<?php
//for-loop to print menu
for ($i=1$i<=6$i++)
{
 echo 
"<li><a href='http://www.srcfarm.com/lvsclasses/php/phpwk$i.php'>Week $i</a></li>";
}
?>
</ul>
</div>

<div id="content">

<table class="tablestyleleft">
<tr><th>Numbers<br />from 1 to 10</th></tr>
<?php
//for-loop to print numbers table
for ($i=1$i<=10$i++)
{
 echo 
"<tr><td class='tablecellstyle'>$i</td></tr>";
}
?>
</table>

<table class="tablestyleright">
<tr><th>Dividing<br />integers by 10</th></tr>
<?php
//for-loop to print division table
$constant 10;
for (
$i=1$i<=10$i++)
{
 
$answer $i $constant;
 echo 
"<tr><td class='tablecellstyle'>$i / $constant = $answer</td></tr>";
}
?>
</table>

<table class="tablestylecenter">
<tr><th>Adding 5 to the<br />first 10 integers</th></tr>
<?php
//for-loop to print addition table
$constant 5;
for (
$i=1$i<=10$i++)
{
 
$sum $i $constant;
 echo 
"<tr><td class='tablecellstyle'>$i + $constant = $sum</td></tr>";
}
?>
</table>

</div>

<div id="foot"></div>

</div>

<?php
show_source
("phpwk2.php");
?>

</body>
</html>