您的位置:首页 > 编程语言 > PHP开发

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

2006-11-30 22:01 1076 查看
<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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: