This is fairly simple...
Caveat: If you have case folding turned on, you will only be able to modify variables are completely upper case-- 'var' will always fold into 'VAR'. Of course, this may be exactly what you want, because it gives you a sandbox to keep users in, as we don't normally use upper-case vars... and if you use <xmltag getvar="varname"/>, they can read any variable, but can only write to certain variables. I don't think arrays work either way, though.
Anyway, here is the code I use:
while (list ($key, $val) = each ($attrs)) {
$$key = $val;
}
It's simple enough thanks to PHP's variable variable support. Another note, don't include the $ when you write the tag...
This should work: <setvar dave="bob"/>
This shouldn't work: <setvar $dave="bob"/>
Hope that helps,
--WorldMaker--