05 2013 档案
OOP in php
摘要:创建一个类 1 class Person{ 2 //类的属性 相当于变量 3 public $firstname; 4 public $lastname; 5 public $age; 6 7 //construct方法 类当中的方法相当于php里的函数 8 public function __construct(){ 9 //对于不同的类 我们可以有不同的属性10 $this->firstname = $firstname;11 $this->lastname = $lastname;12 ...
阅读全文