PHP快速入门教程:WHILE循环的使用示例

mac2022-06-30  26

<html>                                                                                                                              <head>                                                                                                                              <title>WHILE循环的使用示例</title>                                <meta http-equiv=content-type content="text/html; charset=gb2312">                                                                   </head>                                                                                                                             <body>                                                                                                                              <h2 align=center >WHILE循环的使用示例</h2>                                                                                          <hr color=red>                                                                                                                      <? //PHP程序开始                                                                                                                    //用来保存各个阶乘                                                $n=1;                                                             $i=1;                                                             /*******************                                              WHILE循环的使用示例                                               $i是循环变量                                                      每次循环时$i自动增1                                               当$i显示到9的时候结束                                             ********************/                                                                                                               while($i<10)                                                        {                                                                   $n=$n*$i;                                                         echo"<h4 align=center >";                                         echo$i;                                                           echo"!=";                                                         echo $n;                                                          echo "</h4>/n";                                                   $i++;                                                           }                                                                                                                                 //php程序结束                                                     ?>                                                                                                                                  </body>                                                                                                                             </html>      

转载于:https://www.cnblogs.com/myitworld/archive/2006/11/30/2214979.html

相关资源:JAVA上百实例源码以及开源项目
最新回复(0)