时间:2021-07-01 10:21:17 帮助过:30人阅读
$str = "图片1:,图片2:";
$str = "图片1:,图片2:";preg_match_all('/src=([\'"])(.+)\1/isU', $str, $m);print_r($m);
Array( [0] => Array ( [0] => src='https://www.gxlcms.com/1.jpg' [1] => src="https://img.gxlcms.com/2.jpg" ) [1] => Array ( [0] => ' [1] => " ) [2] => Array ( [0] => https://www.gxlcms.com/1.jpg [1] => https://img.gxlcms.com/2.jpg ))
一定要把单引号、双引号也匹配出来吗?
那就不明白你在想什么了
好吧,多谢老徐回答。