You are on page 1of 1

1 <!

DOCTYPE html>
2 <html>
3
4 <body>
5 <center>
6 <h1 style="color: green;">
7 Tables(प����)
8 </h1>
9
10 <h3>
11 Program to print multiplication<br>
12 table of any number in PHP
13 </h3>
14
15 <form method="POST">
16 Enter a number:
17 <input type="text" name="number">
18
19 <input type="Submit"
20 value="Get Multiplication Table">
21 </form>
22 </center>
23 </body>
24
25 </html>
26
27 <?php
28 if($_POST) {
29 $num = $_POST["number"];
30
31 echo nl2br("<p style='text-align: center;'>
32 Multiplication Table of $num: </p>
33 ");
34
35 for ($i = 1; $i <= 10; $i++) {
36 echo ("<p style='text-align: center;'>$num"
37 . " X " . "$i" . " = "
38 . $num * $i . "</p>
39 ");
40 }
41 }
42 ?>
43

You might also like