Home > Backend Development > PHP Tutorial > 如何从字符串中一次全部截取出来

如何从字符串中一次全部截取出来

WBOY
Release: 2016-06-13 10:24:56
Original
788 people have browsed it

怎么从字符串中一次全部截取出来?
一个页面,有N多DIV,但有部分DIV的class都一样。

怎么把

内容
,中的内容提取出来。

请注意,class=body的DIV不止一个。

谢谢各位了~~多谢~

------解决方案--------------------
PHP code
$str=sad;flksadj;flkd<div class="body">bbbbbbbbbb</div><div class="bo">cccccccccccc</div><div class="body">sad;flksadj;flkd</div>div;preg_match_all('/<div class="body">(.*)/isU',$str,$m);print_r($m[1]);<div class="clear">
                 
              
              
        
            </div>
</div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template