diff --git "a/\350\203\241\346\242\246\347\217\202/20220217_\351\235\242\345\257\271\345\257\271\350\261\241.md" "b/\350\203\241\346\242\246\347\217\202/20220217_\351\235\242\345\257\271\345\257\271\350\261\241.md" new file mode 100644 index 0000000000000000000000000000000000000000..e521bbeed7d70e28a089e55b7e43b1149efd3cb5 --- /dev/null +++ "b/\350\203\241\346\242\246\347\217\202/20220217_\351\235\242\345\257\271\345\257\271\350\261\241.md" @@ -0,0 +1,71 @@ +price=$price; + $this->type=$type; + } + function show(){ + echo " + 这辆车的品牌为: $this->type, + 价格为:$this->price 元 + "; + } + } + $a=new car(1000000,"兰博基尼"); + $a->show(); + //2、 在上例的基础上为汽车类定义一个子类——跑车类。为子类实例化对象并访问父类的属性。 + class roadster extends car{ + + +} +$b=new roadster(3000000,"保时捷"); +$b->show(); +//3、 定义一个类,分别定义3个公共的属性和方法,3个受保护的属性和方法,3个私有属性和方法。 +class demo{ + public $a; + public $b; + public $c; + public function a(){ + + } + public function b(){ + + } + public function c(){ + + } + protected $a1; + protected $b1; + protected $c1; + protected function a1(){ + +} + protected function b1(){ + + } + protected function c1(){ + + } + private $a2; + private $b2; + private $c2; + private function a2(){ + + } + private function b2(){ + + } + private function c2(){ + + } + +} \ No newline at end of file diff --git "a/\350\203\241\346\242\246\347\217\202/20220518_\344\270\212\344\274\240\346\226\207\344\273\266.md" "b/\350\203\241\346\242\246\347\217\202/20220518_\344\270\212\344\274\240\346\226\207\344\273\266.md" new file mode 100644 index 0000000000000000000000000000000000000000..6f73c4cb063a386dcc580236142ac85b4f8ae833 --- /dev/null +++ "b/\350\203\241\346\242\246\347\217\202/20220518_\344\270\212\344\274\240\346\226\207\344\273\266.md" @@ -0,0 +1,60 @@ +```html + + +
+ +