Your safest bet would be to parse the HTML with DOMDocument
, extract the script's contents, then parse that as HTML. This will give you access to the images. Like so:
$dom = new DOMDocument();
$dom->loadHTML($your_html_here);
$script = $dom->getElementsByTagName('script')->item(0);
$dom->loadHTML($script->nodeValue);
$imgs = $dom->getElementsByTagName('img');
foreach($imgs as $img) {
$src = $img->getAttribute("src");
// do something
}