Get image url from a <img> tag via preg_match
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3820666/grabbing-the-href-attribute-of-an-a-element">Grabbing the href attribute of an A element</a>  </p>
</blockquote>



<p>there is image:</p>

<pre><code>&lt;img id="image" src="/dxkxkx.jpg" /&gt;
</code></pre>

<p>I want to get image url from the <code>&lt;img&gt;</code> tag which its <code>id="image"</code> by preg_match, but below my codes failed, I got nothing from output:</p>

<pre><code>&lt;?php
  preg_match('/&lt;img id=\"image\".+src=\"?(.+\.(jpg|jpeg|png))\"?.+&gt;/i', $content, $matches);
  print_r($matches);
?&gt;
</code></pre>

<p>Please help,thanks in advance.</p>
