Possible Duplicate:
RegEx match open tags except XHTML self-contained tags
How to parse and process HTML/XML with PHP?
I have a current line of code as part of a image download script that looks like this:
preg_match_all('|<img.*?src=[\'"](.*?)[\'"].*?>|i', $content, $matches);
I need to alter this to include:
id="iwi"
within the preg_match_all command. The img is always in this format:
I've tried a few different variations and am getting errors and finally tried without the quotes like below and still nothing, is my syntax wrong?
preg_match_all('|<img.*?id=iwi.*?src=[\'"](.*?)[\'"].*?>|i', $content, $matches);