Heim > Fragen und Antworten > Hauptteil
<p class="quote"><p class="quote-hd"><span class="floor">第1楼</span>哈哈哈</p><p class="quote-bd"><p>ceshi</p><p><img src="public/js/ueditor143/dialogs/emotion/images/classic/007.gif"/></p></p></p>
我的正则,preg_match('/<p class='quote-hd'><span class='floor'>(.?)</span>(.?)</p><p class='quote-bd'>(.*?)</p>/is', $quote_content, $match);
取不到值。。。。
目标取出:
第1楼
哈哈哈
<p>ceshi</p><p><img src="public/js/ueditor143/dialogs/emotion/images/classic/007.gif"/></p>
伊谢尔伦2017-04-10 18:12:07
$s='<p class="quote"><p class="quote-hd"><span class="floor">第1楼</span>哈哈哈</p><p class="quote-bd"><p>ceshi</p><p><img src="public/js/ueditor143/dialogs/emotion/images/classic/007.gif"/></p></p></p>';
preg_match('#<p class="quote-hd"><span class="floor">(.*?)</span>(.*?)</p><p class="quote-bd">(.*?)</p>#is', $s, $match);
print_r($match);