Quote:
|
Originally Posted by BigBen
Thanks for the help. What can I use to match just the image name from the string extracted from the first match?
Ie. How do I match just pic.jpg out of: src="http://example.com/images/pic.jpg"
I tried: preg_match("/\/.+?\.jpg/", $matches[1], $imagematch);
but that matches the longest string possible (//example.com/images/pic.jpg)
Thanks.
|
Maybe do a greedy match at first, just to get all the full & relative paths to the actual images grabbed out of the src tags. Then implode that $matched array into a string. Against that string, do a more refined match to just grab out the image names.