Preg Match

Trying to match image location from the following:

<a id="ctl00_Main_ctl00_UserBasicInformation1_hlDefaultImage" href=";friendID=142797907"><img border="0" alt="" src="" />

Using the following:


		$string_ahref = $match[0];
		//echo "string = ".$string_ahref;

		$substr = substr($string_ahref,0,350);
		$trimed = strip_tags($substr,"<img>");
		$trimed = trim($trimed);[/code]

It keeps returning more than the img src it returns:

r="0" alt="" src="

When it should only return:

Any ideas?

$match[1] should contain the url, without having to use substr, strip_tags and trim.

just use $trimed = $match[1];

Sponsor our Newsletter | Privacy Policy | Terms of Service