I need to find all the image html tags that are included in a page using PHP regular expressions
Example
<img src="images/image.jpg" />
My code
preg_match('/<img src=\"images\/.*/',$tags,$matches);
The strange thing is it only finds the first occurence, not the rest of the tags in the page
Use
preg_match_all.preg_matchonly finds the first occurence, whilepreg_match_allfinds all occurrences of the pattern.