PHP is a frequently asked question by teachers. today I will print the multiplication statement again. The PHP code is as follows: & lt ;? Php ** print the multiplication Port limit table * echo & quot; 9-9 multiplication Port limit table & lt; br & gt;
PHP is a frequently asked question by teachers. today I will print the multiplication statement again. The PHP code is as follows:
-
-
- /*
- * Print the multiplication Port reject table
- */
- Echo "Jiu Ling Jiu multiplication Port reject table
";
- Echo"
- For ($ I = 1; $ I <= 9; $ I ++ ){
- Echo"
- For ($ j = 1; $ j <= $ I; $ j ++ ){
- Echo"
- }
- Echo"
- }
-
- Echo"
";
";
". $ J." * ". $ I." = ". ($ j * $ I )." | ";
";
";
- Echo"
";
- Echo"
- For ($ I = 1; $ I <= 9; $ I ++ ){
- Echo"
- For ($ j = $ I; $ j <= 9; $ j ++ ){
- Echo"
- }
- Echo"
- }
-
- Echo"
";
";
". $ I." * ". $ j." = ". ($ j * $ I )." | ";
";
";
- ?>
A simple sum
- Function sum ($ n)
- {
- If ($ n> 1)
- {
- Return sum ($ n-1) + $ n;
- } Else
- {
- Return 1;
- }
- }
- Echo sum (1, 100 );