$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 [email protected]";
//在這里補充代碼,實現正則匹配,并輸出郵箱地址
$p="/[\w\s]+is\s([\w]+@[\w]+\.com)/";
preg_match($p,$subject,$match);
echo $match[1];
$subject = "my email is [email protected]";
//在這里補充代碼,實現正則匹配,并輸出郵箱地址
$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
php的重載只是動態的創建屬性與方法,與其他語言不一樣。
而且重載方法,并不是創建一個方法,只是轉調用__call函數。而屬性會創建。
而且重載方法,并不是創建一個方法,只是轉調用__call函數。而屬性會創建。
2014-12-06