Online Shopping : Computers : Programming : Languages : PHP : Common Problems : Regular Expressions

+ Search
Add Entry AlertManage Folder Edit Entry Add page to
Did You Find This Entry Useful?

14 of 26 people (54%) answered Yes
Recently 7 of 10 people (70%) answered Yes


How can you list all <img> tag from a html page in a array (using Regular Expressions)

Apr 18th, 2007 00:30
mohd jaffry d jalal, Timon -,

This regex pattern helped me strip img tags from a html source -
In PHP, you could implement it like so -
preg_match_all("<img[^<>]+>", $myHTMLsource, $arrayToSaveMatchesIn);