extracting image tag from a html code in php
<p>I'm trying to fetch my articles and I need to make a slider out of them.</p>

<p>Each of my articles has an image inside it's text, like this: </p>

<pre><code>&lt;p&gt;
&lt;img src="story_img.jpg" width=120 height=80&gt;
In the last couple of weeks I often had to download a lot of files, submitted to a web-based teaching platform. Downloading all these files by hand is very annoying so I implemented a short Groovy script. Since Groovy has a great support for parsing well-formed XML-like information it fails if you want to parse unstructured and nasty HTML code.
&lt;/p&gt;
</code></pre>

<p>Now what I need is simple, first I should parse the image and then remove it from the text .</p>

<p>So that I could have 2 constants </p>

<pre><code>$imgOfText = ?

$TextWithOutImg = ?
</code></pre>

<p>I tried different ways in php and <a href="http://stackoverflow.com/questions/138313/how-to-extract-img-src-title-and-alt-from-html-using-php">even read this topic.</a></p>

<p>But I couldn't do that.</p>
