这种不对吗?
$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
$fruit['orange']="橘子";
print_r($fruit);
//这样过不了呢?
print_r($fruit);
//这样过不了呢?
2014-12-18
<?php
$fruit=array('苹果','香蕉','菠萝');
foreach($fruit as $k=>$v){
echo '<br>第'.$k.'值是:'.$v;
}
?>
//这样写无法通过么?为什么?
$fruit=array('苹果','香蕉','菠萝');
foreach($fruit as $k=>$v){
echo '<br>第'.$k.'值是:'.$v;
}
?>
//这样写无法通过么?为什么?
2014-12-18