How to get IMG tag code from HTML document?

Reilan

New Member
how I get the \[code\]img\[/code\] code from a text?Now I get the code and URL if the tag looks like: \[code\]text text <img src = "http://stackoverflow.com/questions/3838887/image.gif" />\[/code\], but if the code is \[code\]<img src = "http://stackoverflow.com/questions/3838887/image.gif" target = _blank />\[/code\], then I get the URL: \[code\]"image.gif" target = _blank\[/code\].So, how correctly find \[code\]img\[/code\] full code and URL?Thanks\[code\]preg_match_all('/\<img src = http://stackoverflow.com/questions/3838887/(.*?)/>/', $input, $all_img);\[/code\]
 
Back
Top