亲,帮忙给看看这个类哪里出有关问题了?出不来表格啊
时间:2021-07-01 10:21:17
帮助过:2人阅读
亲,帮忙给看看这个类哪里出问题了?出不来表格啊???
class Create{
var $i;
var $j;
function table(){
echo "
";
if($a=1;$a<=$i;$a++){
echo "";
if($b=1;$b<=$j;$b++){
echo "$nbsp; | ";
}
echo "
";
}
echo "
";
}
}
$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 "
";
for($a=1;$a<=$this->i;$a++){
echo "";
for($b=1;$b<=$this->j;$b++){
echo " | ";
}
echo "
";
}
echo "
";
}
}
$table=new Create();
$table->i=3;
$table->j=4;
$table->table();