玩轉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."
相關文章
相關標籤/搜索