Reputation: 395
I have a string with a number of 'shortcodes' in thus (just using an example):
$str = "[video src="http://www.aaa..." options="autoplay controls loop mute"]\n
[video src=" http://www.bbb..." options="autoplay controls loop mute"]";
I'm trying to match each one independantly using preg_match() thus:
pregmatch( '/\[video.*\]/', $str, $matches );
Now I expect count($matches);
to return '2'. But I only get 1 each time. Is my regular expression wrong? I need to assaign each [video ...... ]
to a new array item so I can deal with them individually.
Thanks
Upvotes: 1
Views: 42