類中的靜態變量應該和函數中的靜態變量意思一樣,不管是類中修改,還是對象中調用方法修改,結果是累加的。
但是靜態方法呢?是不是靜態方法只是用來操作靜態屬性的?
但是靜態方法呢?是不是靜態方法只是用來操作靜態屬性的?
2014-12-19
$filename = '/data/webroot/usercode/resource/test.txt'; 遇到這個地址,自己手動去掉單獨的那個code吧
2014-12-19
這種不對嗎?
$str = "<ul>
<li>item 1</li>
<li>item 2</li>
</ul>";
$p = '/<[^>]+>(.*?)<\/[^>]+>/';
preg_match_all($p,$str,$matches);
print_r($matches[1]);
$str = "<ul>
<li>item 1</li>
<li>item 2</li>
</ul>";
$p = '/<[^>]+>(.*?)<\/[^>]+>/';
preg_match_all($p,$str,$matches);
print_r($matches[1]);
2014-12-18
$subject = "my email is [email protected]";
//在這里補充代碼,實現正則匹配,并輸出郵箱地址
$p = '/[\w\-\d]+@[\w\-\d]+\.[com|cn]+/';
preg_match($p,$subject,$matches);
print_r($matches);
//在這里補充代碼,實現正則匹配,并輸出郵箱地址
$p = '/[\w\-\d]+@[\w\-\d]+\.[com|cn]+/';
preg_match($p,$subject,$matches);
print_r($matches);
2014-12-18
正確答案:
class Truck extends Car{
public function speedUp(){
$this->speed=parent::speedUP()+50;
return $this->speed;
}
}
class Truck extends Car{
public function speedUp(){
$this->speed=parent::speedUP()+50;
return $this->speed;
}
}
2014-12-18
class Truck extends Car{
public function speedUp(){
$this->speed +=50;
return $this->speed;
}
}
public function speedUp(){
$this->speed +=50;
return $this->speed;
}
}
2014-12-18