Copy code The code is as follows:
/* Loop structure
* 1. while loop
* while(expression)
* {
* loop body;//repeatedly execute until the expression is false
* }
* 2. do-while loop
* 3. for loop
*
* According to different loop conditions, there are two types of loops
*
* One: counting loop (generally use for)
* The other: conditional loop (Generally use while do-while)
*
*
*
*/
//Usage of while
/*$num=0;
while($num< ;100)
{
echo "Output result{$num}";
$num++;
}*/
//while output table
echo '
';
echo 'Use while to output the table
';
$ i=0;
while($i<1000)
{
//Change a line every 10 times
if($i%10==0)
{
if( $i%20==0)
{
$bg="#ffffff";
}
else
{
$bg="#cccccc";
}
echo '';//Output interlaced color change
}
echo ''.$i.' | ';
$i++;
if($i%10==0)
{
echo '
}
}
echo '
';
?>
http://www.bkjia.com/PHPjc/323565.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/323565.htmlTechArticleCopy the code as follows: ?php /* Loop structure* 1. while loop* while (expression) * { * Loop body;//Execute repeatedly until the expression is false* } * 2. do-while loop* 3. for loop...