Why does this code not find picture links in text?
$text = 'text text <img src = "http://www.singlewheel.com/Scoots/PAV/Martin7PAV/42316.jpg" /> text text';
preg_match_all('#^http:\/\/(.*)\.(gif|png|jpg)$#i', $text, $all_img);
Why does this code not find picture links in text?
$text = 'text text <img src = "http://www.singlewheel.com/Scoots/PAV/Martin7PAV/42316.jpg" /> text text';
preg_match_all('#^http:\/\/(.*)\.(gif|png|jpg)$#i', $text, $all_img);
Remove the ^ and $ and if you want to capture the url for later use surround in ()
preg_match_all('#(http:\/\/(.*)\.(gif|png|jpg))#i', $text, $all_img);