php使用正则表达式获取图片url的方法
具体实现方法如下:
代码如下:
header("Content-type:text/html;charset=utf-8");
$str = '

$pattern = "/[img|IMG].*?src=['|\"](.*?(?:[.gif|.jpg]))['|\"].*?[\/]?>/";
preg_match_all($pattern,$str,$match);
echo "";
print_r($match);
?>
http://www.bkjia.com/PHPjc/944935.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/944935.htmlTechArticlephp使用正则表达式获取图片url的方法 具体实现方法如下: 代码如下:?php header(Content-type:text/html;charset=utf-8); $str = 'pimg src=https://www.gxlcms.com/images/11111111.jpg a...