Hello folks,
I am an advanced newbie. I have never spent a day in college, and don't know the first thing about programming in C+. I assume that is why I have such a difficult time creating regular expressions!!
Here's my dilema:
$examplehtml='a bunch of text. <br>more text.<img src="somegif.gif."width="122" height="22">Some more text. <img src="anothergif.gif"> etc...................<br> ...more text!!!<img src="gif.gif">';
//Just basically random html..
I need to create some kind of preg_match_all (i think its the best way) that will allow me to search $examplehtml ... find all occurences of {img src"=} and take whats in between that and the ending {"} to basically give me the path/imagename ... I have spent hours trying to make this work, and I can actually get results using ereg. The problem is that I need to extend this a little bit, to allow me to do a foreach(). Somthing like:
foreach($results_of_the_pregmatch as $image){
echo"$image";
}
I can not do this using ereg, and after hours of studying the manual, it seems that my best option would be preg_match_all, but the examples are limited, and I suck at regular expressions(even after going over the tutorials on this site(both 1 and 2 😉), so I am lost. If anyone can offer some assistance, I would be very appreciative.