| preg match all and link
|
Lolalola

msg:4180457 | 7:35 am on Aug 2, 2010 (gmt 0) | hi, how find in text only one image?
$text = 'text text <img src = "http://physics.unl.edu/dept/directories/images/gradpics/Cat.jpg" /> text text <img src = "www.url.com/image.gif" />'; preg_match_all('#http:[^<\s>]+[.](gif|png|jpe?g)#i', $text, $all_img);
print_r($all_img);
|
redhatlab

msg:4181095 | 11:49 am on Aug 3, 2010 (gmt 0) | Hi, Regex can be painful and a simple variation can brake the rule. I have use for project where I need to extract data the "PHP Simple HTML DOM Parser", this is a really nice library that will get all the images with minimum effort.
// Find all images foreach($html->find('img') as $element) echo $element->src . '<br>';
|
|
|