如题所述
第1个回答 2013-11-01
<?php
function table($rows,$cols){
$str = "<table>";
for($i=0;$i<$rows;$i++){
$str .= "<tr>";
for($j=0;$j<$cols;$j++){
$str .= "<td>你要显示的内容</td>";
}
$str .= "</tr>";
}
$str .= "</table>";
return $str;
}echo table(4,5);?>本回答被网友采纳
function table($rows,$cols){
$str = "<table>";
for($i=0;$i<$rows;$i++){
$str .= "<tr>";
for($j=0;$j<$cols;$j++){
$str .= "<td>你要显示的内容</td>";
}
$str .= "</tr>";
}
$str .= "</table>";
return $str;
}echo table(4,5);?>本回答被网友采纳