<?php
class Create{
var $i;
var $j;
function table(){
echo "<table>";
if($a=1;$a<=$i;$a++){
echo "<tr>";
if($b=1;$b<=$j;$b++){
echo "<td>$nbsp;</td>";
}
echo "</tr>";
}
echo "</table>";
}
}
$table=new Create();
$table->i=3;
$table->j=4;
$table->table();
?>
------解决方案--------------------
class Create{
var $i;
var $j;
function table(){
echo "<table>";
for($a=1;$a<=$this->i;$a++){
echo "<tr>";
for($b=1;$b<=$this->j;$b++){
echo "<td> </td>";
}
echo "</tr>";
}
echo "</table>";
}
}
$table=new Create();
$table->i=3;
$table->j=4;
$table->table();