Well, unless someone comes up with a better idea (which I wouldn't think would be that hard... 😉) here is what I came up with in the meantime...
$tagtable = array();
$i = 0;
if (isset($taginfo[2])) {
$valuepair = explode(" ", $taginfo[2]);
$tagtable[$i]['TAGTYPE'] = trim($taginfo[1]);
foreach($valuepair as $pair) {
list($key, $value) = explode("=", $pair);
$tagtable[$i][$key] = $value;
}
$i++;
}
So the output looks like this:
Array
(
[0] => Array
(
[TAGTYPE] => MTPL_VAR
[NAME] => USERNAME
[TITLE] => SOMETHING
)
[1] => Array
(
[TAGTYPE] => MTPL_VAR
[NAME] => USERINFO
)
)
The key/values are the things like [NAME] => USERNAME, and [TITLE] => SOMETHING, etc.