结果显示: Array ( [0] => Array ( [0] => ) [1] => Array">
时间:2021-07-01 10:21:17 帮助过:5人阅读
$str='';
$pattern="/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg]))[\'|\"].*?[\/]?>/";
preg_match_all($pattern,$str,$match);
print_r($match);
?>
结果显示:
Array
(
[0] => Array
(
[0] =>
)
[1] => Array
(
[0] => https://www.gxlcms.com/upfiles/2009/07/1246430143_1.jpg
)
)http://www.bkjia.com/PHPjc/324555.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/324555.htmlTechArticle 代码如下:
?php $str='pimg border="0" src="https://www.gxlcms.com/upfiles/2009/07/1246430143_1.jpg" alt=""//p'; $pattern="/[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg]))[\'|\"].*?[\/]?/";...