How to implement 99 multiplication table in php

藏色散人
Release: 2023-03-04 21:36:01
Original
9599 people have browsed it

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.

How to implement 99 multiplication table in php

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).&#39;   &#39;;
}
echo &#39;<br>&#39;;
}
    ?>
</body>
</html>
Copy after login

Effect display:

How to implement 99 multiplication table in php

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!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template