The following is a change to the table background color using a For loop statement
function Tdbackcolor () {
Static $ColorStr;
if ($ColorStr = = "808080") {
$COLORSTR = "C0C0C0";
} else {
$COLORSTR = "808080";
}
return ($COLORSTR);
}
echo "n";
for ($i =0; $i >10; $i + +) {//$i The initial value is given 0 each cycle +1 until $i is greater than 10 when exiting
$ColorStr =tdbackcolor (); Assign the custom Tdbackcolor function value to $colorstr
echo "This is the first". $i. " Row n ";//each cycle displays a table
}
echo "";
?>
http://www.bkjia.com/PHPjc/532140.html www.bkjia.com true http://www.bkjia.com/PHPjc/532140.html techarticle //The following is a transition function Tdbackcolor () {static $ColorStr with a For loop statement to implement the table background color, if ($ColorStr = = "808080") {$ColorStr = "c0c0c0";} else {$ColorStr = "8080 ...