时间:2021-07-01 10:21:17 帮助过:5人阅读
$handle="http://ec2.images-amazon.com/images/I/311%2Bk07cuIL._SL500_AA280_.jpg,http://ec2.images-amazon.com/images/I/418Qdk6bctL._SL500_AA280_.jpg,http://ec2.images-amazon.com/images/I/51bsLAswKVL._SL500_AA280_.jpg";preg_match_all('#src="(http://ec2\.images-amazon\.com/images/I/[a-z\d]+\._SL500_AA280_\.jpg)"#is',$handle,$m);print_r($m[1]);
源码中没有 src=" 字符,当然匹配不了。这样写:
preg_match_all('#http://ec2\.images-amazon\.com/images/I/.+?\._SL500_AA280_\.jpg#is',$handle,$m); print_r($m);