在本类中调用私有的属性或者方法
class Car {
private $speed = 0;
public function getSpeed() {
return $this->speed;
}
protected function speedUp() {
$this->speed += 10;
}
//增加start方法
public function start(){
$this->speedUp();
}
}
class Car {
private $speed = 0;
public function getSpeed() {
return $this->speed;
}
protected function speedUp() {
$this->speed += 10;
}
//增加start方法
public function start(){
$this->speedUp();
}
}
2015-03-09
"/<li>(.*)<\/li>/i" /i忽略大小写
http://php.net/manual/zh/reference.pcre.pattern.modifiers.php
http://php.net/manual/zh/reference.pcre.pattern.modifiers.php
2015-03-07