Been trying to figure this out for a short while now but having now luck, for example I have an external xml document like this:
&
The simplest method is to use SimpleXML:
$xml = simplexml_load_string(... your xml here...);
$values = array()
foreach($xml->positions as $pos) {
$values[$pos] = $pos;
}
You do not want to auto-create variables in the manner you suggest - it litters your variable name space with garbage. Consider what happens if someone sends over an XML snippet which has
and you create a variable of that name - there goes your $_SERVER superglobal.