Heim >Backend-Entwicklung >PHP-Tutorial >标签-php正则表达式问题????

标签-php正则表达式问题????

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-02 11:28:021044Durchsuche

标签stringphp正则表达式

<code> <?php $pattern = "/<p.*p>|<div>]+>/";    $str = "<div style='\"width:100px\"'>无语<p>hi</p>
</div>";    preg_match_all($pattern,$str,$matches);    var_dump($matches);?><p>请问为什么结果是:</p>
<pre class="brush:php;toolbar:false"><code> array (size=1)  0 =>     array (size=2)      0 => string '<div style="width:100px">' (length=25)      1 => string '<p>hi</p>' (length=13)<p>应该先匹配出p标签吗?</p>                                    </div></code>
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:设计-网站框架整合问题,请各位大牛指点!Nächster Artikel:思路-php怎么查询当前是校历的第几周

In Verbindung stehende Artikel

Mehr sehen