亲,帮忙给看看这个类哪里出问题了?出不来表格啊???
<?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();
?>
[解决办法]
本帖最后由 xuzuning 于 2013-02-01 10:56:02 编辑 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();