Hey, can you tell me what went wrong with this class? What about the external table ??? & Lt ;? Phpclass & nbsp; Create {& nbsp; var & nbsp; $ I; & nbsp; var & nbsp; $ j; & nbsp; functio, could you tell me what went wrong with this class? What about the external table ???
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 ();
?>
------ Solution --------------------
At the end of this post, xuzuning edited 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 ();