- preg_match: documentation ( source)
- print_r: documentation ( source)
<?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[0];
print_r($oldUrl);
}
?>