下面的php代码分别对变量$a和$b进行循环累加
<html>
<body>
<?php
$a = 0;
$b = 0;
for( $i=0; $i<5; $i++ )
{
$a += 10;
$b += 5;
}
echo ("At the end of the loop a=$a and b=$b" );
?>
</body>
</html>
输出结果
At the end of the loop a=50 and b=25
下面的php代码分别对变量$a和$b进行循环累加
<html>
<body>
<?php
$a = 0;
$b = 0;
for( $i=0; $i<5; $i++ )
{
$a += 10;
$b += 5;
}
echo ("At the end of the loop a=$a and b=$b" );
?>
</body>
</html>
输出结果
At the end of the loop a=50 and b=25