我不明白如何在 PHP preg_replace 中用另一个 div 替换一个 div
$string ='
<div id="myid">this has to be replaced</div>
<p>here is something</p>
<div id="any">any text not to be replaced</div>
';
如果我做
$string = preg_replace('/<div id=\"myid\">.*<\/div>/','anything',$string);
它不起作用,我不明白为什么?!