With PHP, how can I isolate the contents of the src attribute from $foo? The end result I\'m looking for would give me just \"http://example.com/img/image.jpg\"
I got this code:
$dom = new DOMDocument(); $dom->loadHTML($img); echo $dom->getElementsByTagName('img')->item(0)->getAttribute('src');
Assuming there is only one img :P