$p="|[^>]+>(.*)</[^>]+>|i";
preg_match_all($p,$str,$matches);
print_r($matches[1]);
这个也可以哟~
preg_match_all($p,$str,$matches);
print_r($matches[1]);
这个也可以哟~
2014-12-07
有点笨o(╯□╰)o
$subject = "my email is spark@imooc.com";
//在这里补充代码,实现正则匹配,并输出邮箱地址
$p="/[\w\s]+is\s([\w]+@[\w]+\.com)/";
preg_match($p,$subject,$match);
echo $match[1];
$subject = "my email is spark@imooc.com";
//在这里补充代码,实现正则匹配,并输出邮箱地址
$p="/[\w\s]+is\s([\w]+@[\w]+\.com)/";
preg_match($p,$subject,$match);
echo $match[1];
2014-12-07
$p = '/[\d]+\-[\d]+/';
$p = '/(0|1)+\-[0-9]+/';
$p = '/[0-1]+\-[0-9]+/';
$p = '/[0-9]+\-[0-9]+/';
$p = '/(0|1)+\-[0-9]+/';
$p = '/[0-1]+\-[0-9]+/';
$p = '/[0-9]+\-[0-9]+/';
2014-12-07
将a,b,c都显示出来
$a:
object(Car)#1 (1) {
["name"]=>
string(7) "new car"
}
$b:
object(Car)#2 (1) {
["name"]=>
string(7) "new car"
}
$c:
object(Car)#3 (1) {
["name"]=>
string(7) "new car"
}
这样看,他们都是由同一个类实例化的?所以后面会有#num?
$a:
object(Car)#1 (1) {
["name"]=>
string(7) "new car"
}
$b:
object(Car)#2 (1) {
["name"]=>
string(7) "new car"
}
$c:
object(Car)#3 (1) {
["name"]=>
string(7) "new car"
}
这样看,他们都是由同一个类实例化的?所以后面会有#num?
2014-12-06