I'm using PHP Simple HTML DOM parser and everithing runs fine until I get this div content . I've been tried all ways to get the src attr, find the a tags, the img, and all fails, I can get the img tag, but only can get the width, height and alt attr (just the part where "some text" appears, not the others strings).
<img width="656" height="370"
alt="some text " .="" othertetx="" anothertext="" anothertext="" anothertext="" anothertext'="" title="same text in the alt attr " src="http://siteurl/getattach/somedir/somefile.aspx">
I think the problem is in the alt attr with all the text with the .= symbols that confuses the parser. This tag is displayed fine in browsers, so, it must be "standard"
Edit:
The answer pointed does not resolve the problem, I know how to get the src, the problem is with this tag. Take the time to full read the question before marking it as duplicate, please. The code provided in the sugested answer does not work with the sample I show.
This
$img_src = $element->src;
if(!strstr($img_src, 'http://')) {
$img_src = $v . $img_src;
}
don't extract the src attr from this
<img width="656" height="370"
alt="some text " .="" othertetx="" anothertext="" anothertext="" anothertext="" anothertext'="" title="same text in the alt attr " src="http://siteurl/getattach/somedir/somefile.aspx">