title: How to replace a whole div with an other with preg_replace regEx
body: <p>i don't get it how to replace a div with an other in PHP preg_replace</p>
  
  <pre><code>$string ='
    &lt;div id="myid"&gt;this has to be replaced&lt;/div&gt;
    &lt;p&gt;here is something&lt;/p&gt;
    &lt;div id="any"&gt;any text not to be replaced&lt;/div&gt;
  ';
  </code></pre>
  
  <p>if i do</p>
  
  <pre><code>$string = preg_replace('/&lt;div id=\"myid\"&gt;.*&lt;\/div&gt;/','anything',$string);
  </code></pre>
  
  <p>it does not work and i don't get why?!</p>