how to get image source from an img tag using php function.
Or, you can use the built-in DOM functions (if you use PHP 5+):
$doc = new DOMDocument();
$doc->loadHTMLFile($url);
$xpath = new DOMXpath($doc);
$imgs = $xpath->query("//img");
for ($i=0; $i < $imgs->length; $i++) {
$img = $imgs->item($i);
$src = $img->getAttribute("src");
// do something with $src
}
This keeps you from having to use external classes.