preg match all - RegEx for preg_match_all in PHP -
this string ($string):
swatch: http://abc.com/not_this_one.jpg, zoom:[ 'http://abc.com/aa.jpg' ], large:[ bbbbbbbbbbb' ], swatch: http://abc.com/not_this_one.jpg, zoom:[ 'http://abc.com/bb.jpg', 'http://abc.com/cc.jpg' ], large:[ http://abc.com/also_not_this_one.jpg' ],
i match http://abc.com/aa.jpg
, http://abc.com/bb.jpg
, , http://abc.com/cc.jpg
using preg_match_all()
. how can that?
preg_match_all('/http:\/\/abc\.com\/(?:aa|bb|cc)\.jpg/', $string, $matches);
Comments
Post a Comment