preg_replace not work $ragid = "/<head> s*(.*?) </head>/i";
<p>html code is</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
 123
&lt;/head&gt;
&lt;body&gt;
 some text
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>and php code is</p>

<pre><code> $body='&lt;html&gt;
    &lt;head&gt;
       123
    &lt;/head&gt;
    &lt;body&gt;
     some text
    &lt;/body&gt;
    &lt;/html&gt;';

    $ragid  = "/&lt;head&gt; s*(.*?) &lt;/head&gt;/i";
    preg_replace($ragid, $head, $body);
</code></pre>

<p>and error is</p>

<pre><code>Warning: preg_replace() [function.preg-replace]: Unknown modifier 'h'
</code></pre>

<p>i want to replace 123 by 123 {my code} </p>

<p>how it is possible ?</p>
