错误将图像标记替换为图像src

$content = 'This fairy tale-like place is based on a story of two lovers who ran away to escape their enemies.
<img src="blisshouse-1.jpg"> <img src="blisshouse-2.jpg">';

preg_match_all('%<img.*?src=["\'](.*?)["\'].*?/>%i', $content, $matches);
if(count($matches) > 0) {
    foreach ($matches as $matche) {
        $content = preg_replace('%<img.*?src=["\'](.*?)["\'].*?/>%i', $matche[1], $content);
    }
}
echo $content;

Result is:

This fairy tale-like place is based on a story of two lovers who ran away to escape their enemies.
blisshouse-1.jpg blisshouse-1.jpg

Error can't replace <img src="blisshouse-2.jpg"> to blisshouse-2.jpg. How to fix it

As @Mario suggested - just use preg_replace

Also, I added a /? because the img tags didn't have slashes.

$content = 'This fairy tale-like place is based on a story of two lovers who ran away to escape their enemies.
<img src="blisshouse-1.jpg"> <img src="blisshouse-2.jpg">';

$content = preg_replace('%<img.*?src=["\'](.*?)["\'].*?/?>%i', '$1', $content);
echo $content;