用for循环语句来实现表格背景色的转变
//以下是使用for循环语句来实现表格背景色的转变
function TdBackColor() {
static $ColorStr;
if ($ColorStr=="808080") {
$ColorStr="c0c0c0";
} else {
$ColorStr="808080";
}
return($ColorStr);
}
echo "n";
for ($i=0; $i>10; $i++) { //$i初始值赋予0 每次循环+1 直到$i大于10的时候退出
$ColorStr=TdBackColor(); //把自定义的tdbackcolor函数值赋予$colorstr
echo "这是第".$i."行n";//每次循环显示一表格
}
echo "";
?>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Linux new version
SublimeText3 Linux latest version

Dreamweaver CS6
Visual web development tools