PHP正则表达式匹配图片地址
<?php $str='<p><img border="0" src="upfiles/2009/07/1246430143_1.jpg" alt=""/></p>'; $pattern="/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg]))[\'|\"].*?[\/]?>/"; preg_match_all($pattern,$str,$match); print_r($match);…
<?php $str='<p><img border="0" src="upfiles/2009/07/1246430143_1.jpg" alt=""/></p>'; $pattern="/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg]))[\'|\"].*?[\/]?>/"; preg_match_all($pattern,$str,$match); print_r($match);…