Copy CodeThe code is as follows:
<?php
/* Loop structure
* One, while loop
* while (expression)
* {
* loop body;/execute repeatedly until the expression is false
* }
* Second, Do-while cycle
* Three, for loop
*
* There are two types of loops that vary according to the cyclic conditions
*
* One: Counting loops (general use for)
* Another: Conditional loops (general use while do-while)
*
*
*
*/
The use of While
/* $num = 0;
while ($num <100)
{
echo "Output {$num}";
$num + +;
}*/
While output table
Echo ' <table border= "1" width= "align=" center ">";
Echo ' <caption>$i = 0;
while ($i <1000)
{
Change the line 10 times
if ($i%10==0)
{
if ($i%20==0)
{
$BG = "#ffffff";
}
Else
{
$BG = "#cccccc";
}
Echo ' <tr bgcolor= '. $bg. ' > '//Output interlace color
}
Echo ' <td> '. $i. ' </td> ';
$i + +;
if ($i%10==0)
{
Echo ' </tr> ';
}
}
Echo ' </table> ';
?>
<script type= "Text/javascript" >
var old=null;
Background with yellow color when mouse is put on
function Orow (obj)
{
Old=obj.bgcolor;
Obj.bgcolor= ' Yellow ';
}
Return the original color when the mouse leaves
function Nrow (obj)
{
Obj.bgcolor=old;
}
</script>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service