Php-output a table
Output a table
23 ptable
Echo'
If ($ I % 10 = 0 ){
Echo"
}
Echo"
';Echo'
Use a while loop output table
';$ I = 0;While ($ I <100 ){
";}# Here, $ I % 10 = 0, the condition statement is true, and the output
Echo"
| ". $ I ." | ";$ I ++; # here, $ I Auto-increment is changed to 1.If ($ I % 10 = 0 ){Echo"
";}/* Here, $ I = 1, the table does not wrap; suppose $ I = 9 before $ I ++ is executed, $ I = 10 after execution, just line feed; if you put $ I ++ behind this if,
The newline is exactly the same as the newline. the subsequent loop will have its own line. the above sentence $ I ++ has the same effect as ++ $ I */
";
?>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
You can also change the color of a line.
23 ptable
Echo'
Results:
';Echo'
Use a while loop output table
';$ I = 0;While ($ I <100 ){If ($ I % 10 = 0 ){If ($ I % 20 = 0) {$ bg = "# fff999";} else {$ bg = "# 333fff ";}//Echo"
";}Echo"
| ". $ I ." | ";$ I ++;If ($ I % 10 = 0 ){Echo"
";} }Echo"
";
?>