玩转PHP(三)

定义一个类,并且声明一个对象。 类外调用函数。 <?php class cat{ var $height; var $weight; var $name; var $age; var $sex; function eat(){ echo $this ->name." are eating."; } function play(){ echo $this ->name." are playing."
相关文章
相关标签/搜索