preg replace image link
<p>I'm trying to preg_replace image link, but only if it ends with .jpg, .gif, .png.</p>

<pre><code> http://exampel.com/1/themes/b2/images/4/image1.jpg
</code></pre>

<p>to</p>

<pre><code>&lt;img src="http://exampel.com/1/themes/b2/images/4/image1.jpg" alt="" width="" height="" /&gt;
</code></pre>

<p>Can someone help me?</p>
