$subject = '
you dead!
hello
james
shit!
hi
- list
';
$pattern = '/这里正则如何写/';
preg_match($pattern, $subject, $matches);
print_r($matches);
$pattern_1 = '/这里正则如何写/';
preg_match($pattern_1, $subject, $matches);
print_r($matches);
分别取到结果如下:
数据一:
you dead!
hello
james
数据二:
shit!
hi
- list
请问正则要如何写才能取出上在的两个DIV中的内容呢。
分享到:
------解决方案--------------------
$subject = '
you dead!
hello
james
shit!
hi
- list
';
preg_match_all('/]+>(([^<]*