1$html = '<img id="12" border="0" src="/images/image.jpg"
2 alt="Image" width="100" height="100" />';
3
4$doc = new DOMDocument();
5$doc->loadHTML($html);
6$xpath = new DOMXPath($doc);
7$src = $xpath->evaluate("string(//img/@src)"); # "/images/image.jpg"