]+src\s*=\s*"([^"]+)"[^>]*>/i', $html, $matches); return $matches[1] ?? []; } // Example usage: $htmlContent = "

Some text

\"Image

More text

"; $imageSources = extractImageSrcs($htmlContent); print_r($imageSources); /* Output: Array ( [0] => image1.jpg [1] => https://example.com/image2.png ) */ ?>