標籤:php初學者
今日課程:PHP開發-零基礎到精通瘋狂實戰教程(第二季)【韋瑋老師】
課程接昨日課程
/*訪問成員方法*/$b ->b();
1、對象和成員訪問
650) this.width=650;" src="https://s5.51cto.com/wyfs02/M00/9D/90/wKioL1mB3vKhI0cvAAFJMgNnIdI089.jpg-wh_500x0-wm_3-wmp_4-s_325565991.jpg" title="36020170802221745246.jpg" alt="wKioL1mB3vKhI0cvAAFJMgNnIdI089.jpg-wh_50" />650) this.width=650;" src="https://s4.51cto.com/wyfs02/M00/9D/90/wKiom1mB31GzlRu0AAHt4Dj1BuU651.png-wh_500x0-wm_3-wmp_4-s_2312847965.png" title="QQ20170802221944.png" alt="wKiom1mB31GzlRu0AAHt4Dj1BuU651.png-wh_50" />
/*$this*/class c{var $name ;//常規屬性private $heigh;//私人屬性public $weigh;//公有屬性static $age;//靜態屬性function b(){//方法用函式宣告echo "i can eat!<br>";}function d(){echo "My name is:".($this -> name).‘<br>‘;$this -> b();} }$p = new c();$p -> name ="da";$p ->d();
650) this.width=650;" src="https://s4.51cto.com/wyfs02/M01/9D/91/wKiom1mB8NyCK6KyAAJEObarCbU907.png-wh_500x0-wm_3-wmp_4-s_2972433603.png" title="QQ20170802233442.png" alt="wKiom1mB8NyCK6KyAAJEObarCbU907.png-wh_50" />
/*構造方法和析構方法*/class e{var $name ;//常規屬性private $heigh;//私人屬性public $weigh;//公有屬性static $age;//靜態屬性function b(){//方法用函式宣告echo "i can eat!<br>";}function d(){echo "My name is:".($this -> name).‘<br>‘;$this -> b();} function __construct(){//構造方法echo "i am gouzao<br>";}function __destruct(){//析構方法echo "i am xigou";}} $q = new e(); //$q -> e(); $q -> d();
本文出自 “一條大大大大廢魚” 部落格,謝絕轉載!
翻身的廢魚——論PHP從入門到放棄需要多久?18