Creates a math table using PHP and HTML
Last active
January 5, 2018 16:05
-
-
Save ReinierC/3541460356ea71c008572bdc10b24514 to your computer and use it in GitHub Desktop.
PHP math table
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>PHP math table</title> | |
</head> | |
<body> | |
<h2>PHP Math table</h2> | |
<?php | |
$numbers =array(); | |
$multiplications =array(); | |
$raisedToThePowerThree =array(); | |
for($i = 1; $i <= 10; $i++){ | |
$numbers[] = $i; | |
} | |
for($i = 1; $i <= 10; $i++){ | |
$multiplications[] = $i * $i; | |
} | |
for($i = 1; $i <= 10; $i++){ | |
$raisedToThePowerThree[] = $i * $i * $i; | |
} | |
?> | |
<table border =\"1\" style='border-collapse: collapse'> | |
<?php | |
for($i = 1; $i <= 10; $i++) { | |
?> | |
<tr> | |
<td><?= $numbers[$i]?></td> | |
<td><?= $multiplications[$i]?></td> | |
<td><?= $raisedToThePowerThree[$i]?></td> | |
</tr> | |
<?php | |
} | |
?> | |
</table> | |
<br/> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment