php函数案例
<html>
<head>
<title>php first one</title>
<meta http-equiv="Content-Type" content="text/html;charset=gbk" />
</head>
<body>
<?php
function table($o=10, $i=10){
echo "<table border='1' align='center' width='600'>";
echo "<caption><h2>通过函数输出表格</h2></caption>";
for($out=1;$out<=$o; $out++){
$bgcolor=$out%2==0 ? "green" : "gray";
echo "<tr bgcolor=".$bgcolor.">";
for($in=1;$in<=$i;$in++){
echo "<td>" .($out*10+$in)."</td>";
}
echo "</tr>";
}
echo "</table>";
}
table($o=20, $i=20);
?>
</body>
</html>
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。