Hi! I need a Regex to get linked images in a page ( not image <img src ) Anyone can help me? I didnt find nothing I tried snoopy with a patch, but it doesnt works Thanks
Do you mean <a href=blabla><img src=blabla></a> with linked images? Do you have an example HTML source?
Yes, for example <a href="http://www.website.tld/full/image.jpg"><img src="http://www.anything.tld/something/image.jpg" alt="cool image"class="adsbox"></a> I need the red text.
<?php preg_match_all("/<a href=\"http:\/\/(.*?).(jpg|jpeg|gif|png)\">/si", $html, $match, PREG_SET_ORDER); for ($i = 0; $i < count($match); $i++) { $image = "http://".$match[$i][1].".".$match[$i][2]; echo $image."<br />\n"; } ?> PHP: PS: I haven't tested the code.
I'm having trouble trying to grab the entire link with the image: blah blah blah <a href="http://www.website.tld/full/image.jpg"><img src="http://www.anything.tld/something/image.jpg" alt="cool image"class="adsbox"></a> text here any ideas?