3v4l.org

run code in 300+ PHP versions simultaneously
<?php $bigKml = "<br><img src='files/bagel.png'><br><br>"; $imgPattern = "/<img src=.*?>/"; preg_match($imgPattern, $bigKml, $imageTags); print_r($imageTags); foreach($imageTags as $imageTag) { $urlPattern = "/'([^']*)'/"; preg_match($urlPattern, $imageTag, $oldUrls); $oldUrl = $oldUrls[1]; //the second element contains the match without the quotes print_r($oldUrl); $newUrl = "/var/www/resources/" + $oldUrl; } ?>

preferences:
25.86 ms | 402 KiB | 5 Q