Home >Backend Development >PHP Tutorial >PHP two-layer filtering to obtain the content of messages
//两层过滤,获取留言的内容 $str='<div id="read_111111" style="font-size:14px;line-height:150%;padding:10px;">测试文字1<div id="lwd_12223"><h6 class="quote"><span class="s3 f12 fn">楼主留言:</span></h6><blockquote class="blockquote">测试文字2..</blockquote></div></div>'; //$str='<div id="read_111111" style="font-size:14px;line-height:150%;padding:10px;">厉害</div>'; //preg_match("/[^.*](style=\"font-size:14px;line-height:150%;padding:10px;\">)(.*)<\/div>.*$/",$str, $str_arr);rrree
The above introduces the two-layer filtering of PHP to obtain the content of the message, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.