<?php
$html = '<p><img src="story_img.jpg" width=120 height=80>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.</p>';
$spot = strpos($html, 'src="', strpos($html, '<img'))+5;
$spot2 =strpos($html, '"', $spot);
$imgOfText = substr($html, $spot, $spot2-$spot);
$spot = strpos($html, '<img');
$spot2 = strpos($html, '>', $spot)+1;
$TextWithOutImg = substr($html,0,$spot).substr($html,$spot2);
echo "Image Source: ".$imgOfText."\n\n";
echo "Text Without Image:\n".$TextWithOutImg;
?>