Home > Backend Development > PHP Tutorial > php中如何用preg_match_all匹配字符串

php中如何用preg_match_all匹配字符串

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-02 11:32:39
Original
1281 people have browsed it

php

<code> <div class="Wrapper">
<div class="colImg"><a href="http://store.shopping.yahoo.co.jp/matsunami/fcdm3.html"></a></div>
<div class="wrCol cf">
<div class="colText"></div>
<div class="colPrice"><p class="price"><em>4,603</em></p></div>
<div class="colStore"></div>
</div>
<div class="itemMatch"><a href="http://topics.shopping.yahoo.co.jp/notice/archives/post_8.html">123</a></div>
</div></code>
Copy after login

我想要获取

<code> <div class="Wrapper"></div></code>
Copy after login

里面的整个内容(包含了6个div,也可能是7个div,所以包含的div个数可能不定),即:

<code><div class="colImg"><a href="http://store.shopping.yahoo.co.jp/matsunami/fcdm3.html"></a></div>
<div class="wrCol cf">
<div class="colText"></div>
<div class="colPrice"><p class="price"><em>4,603</em></p></div>
<div class="colStore"></div>
</div>
<div class="itemMatch"><a href="http://topics.shopping.yahoo.co.jp/notice/archives/post_8.html">123</a></div></code>
Copy after login

如何用preg_match_all获取如上字符串,或者用其他方法来实现?

Related labels:
php
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template