类中的静态变量应该和函数中的静态变量意思一样,不管是类中修改,还是对象中调用方法修改,结果是累加的。
但是静态方法呢?是不是静态方法只是用来操作静态属性的?
但是静态方法呢?是不是静态方法只是用来操作静态属性的?
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 spark@imooc.com";
//在这里补充代码,实现正则匹配,并输出邮箱地址
$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