Codice PHP:
$testo "testo <img src=\"img/test.png\"> e testo";

if (
preg_match('/src="(.*?)"/i'$testo$match))
{
    
$testo $match[1];
}

echo 
$testo