This function gets all the image tags in a page
f
<?php
// $content is a string holding the whole html code of the page
function getImageTags($content)
{
$pattern="/<\s*img\s*(.*?)>/i";
preg_match_all($pattern,$content,$matches,PREG_PATTERN_ORDER);
return $matches[0];
}
?>
Comments
Post a Comment