<!<!DOCTYPE html> <html> <body> <h1>我的第一个 PHP 页面</h1> <h2>九九乘法口诀</h2> <?php function f( $x ){ for ( $n =1; $n <= $x ; $n ++) { $s = $n * $x ; # echo $n , 'x' , $x , '=' , $s , " \n" , "<b>" ; if ( $s >9) { echo "<span style=\"color:#0000FF;font-size:20px;margin-left:10px;font-weight:bold;background-color:#00FF00\">" . $n . "x" . $x . "=" . $s . "</span>" ;} else { echo "<span style=\"color:#0000FF;font-size:20px;margin-left:10px;font-weight:bold;background-color:#00FF00\">" . $n . "x" . $x . "=" . $s . " </span>" ;} } } for ( $i =1; $i <10; $i ++){ f( $i ); echo "<br>" ; } ?> </body> </html> |