Home > Article > Backend Development > How to implement 99 multiplication table in php
php method to implement 99 multiplication table: first set the i-th row to have i column; then make each record equal to the current column times the current row; finally pass "echo "{$j}*{$i }=".($j*$i).' ';" The method outputs the 99 multiplication table.
Recommended: "PHP Video Tutorial"
Write a multiplication table using PHP:
Rules:
1. The i-th row has i column.
2. Each record is equal to the current column times the current row.
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>九九乘法表</title> </head> <body> <?php for($i=1;$i<10;$i++){ for($j=1;$j<=$i;$j++){ echo "{$j}*{$i}=".($j*$i).' '; } echo '<br>'; } ?> </body> </html>
Effect display:
Style and table styles can be added by yourself later.
The above is the detailed content of How to implement 99 multiplication table in php. For more information, please follow other related articles on the PHP Chinese website!