Generate Multiplication Table of a Given Number in PHP
In this article, we discuss how to generate a table of any number in PHP using for loop.
<!DOCTYPE html>
<html>
<head>
<title> Generate Multiplication Table of a Given Number in PHP - LoinHearts</title>
</head>
<body>
<form name="form" >
<input type="number" name="num" required ><br><br>
<input type="submit" name="generate" value="Generate" >
</form>
<?php //php start tag
echo"<a href='loinhearts.blogspot.in' >Loinhearts </a>";
if(isset($_GET['generate']))
{
$number = $_GET['num'];//Number that user enter
for ($i = 1; $i <= 10; $i++)
{
echo "<br>".$i*$number; //print the multiplication table of number
}
}
//php end tag ? >
?>
</body>
</html>
<!-- If you face any type of problem then mention in comment section -->
if you need that the multiplication table is shown in the HTML table arrangement then contact us with post link or mention in the comment section.
if you have face any type of issue then you can also mention in comment box.
I read it with pleasure while reading good content.
ردحذفtarzinburda.com
إرسال تعليق