I want to create a custom tag for a site and i need some regex to work through the parameters.
let's say that i've got a string that holds a bunch of text / html and also contains this tag
[customtag type="test" width="120" height="233"]
I would like to end up with
$customtag as an array
$customtag['type'] = 'test'
$customtag['width'] = 120
here's what i got so far:
$pattern = '#\\[customtag([^\]]+)\]#smi';
preg_match_all($pattern, $content, $matches);
but how do I pregmatch the matches to get the different attributes out in an array?