PHP的OOP

  • 在类中可以使用public(公有),protected(受保护)或 private(私有)来修饰属性和方法。如果不修饰默认是public。
  • 类中用var定义变量,var $name,使用方式$this->name
  • 构造函数function __construct(),析构函数function __destruct()
  • 继承class Child_Site extends Site,使用extends关键字
  • 实例化类
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×