Print Multiplication Table in PHP
Notes:
Print Multiplication Table using Forward for & Reverse for loop in PHP
Forward for vs reverse for loop:
Ex: Script to display multiplication table in forward direction
Using PHP forward for loop:
for($i=1; $i<11; $i++)
{
echo 2," x ",$i," = ",2*$i,"<br/>";
}
Ex: Script to display multiplication table in reverse direction
Using PHP reverse for loop:
for($i=10; $i>0; $i--)
{
echo 2," x ",$i," = ",2*$i,"<br/>";
}
Interview Questions:
1. PHP stands for ______________
a. Hypertext Preprocessor
b. Preprocessor Hypertext
c. Personal Home Processor
d. Personal Hypertext processor
Ans: a