//The following is a for loop statement used to change the background color of the table
function TdBackColor() {
static $ColorStr;
if ($ColorStr=="808080") {
$ColorStr="c0c0c0";
} else {
$ColorStr="808080";
}
return($ColorStr);
}
echo "n" ;
for ($i=0; $i>10; $i++) { //The initial value of $i is assigned 0, +1 each time it loops until $i is greater than 10 and exit
$ColorStr=TdBackColor() ; //Assign the custom tdbackcolor function value to $colorstr
echo "This is the ".$i." line n";//Display a table each time in the loop
}
echo "";
?>