Hello everyone,
i have a little problem with variable variables if the variable is an multidimensional array and the indexes are not fix so, they are dynamic.
I need something like this:
$varName = "data";
$varIndex = "[1]['items'][4]['items'][]";
${varName.$varIndex} = 'xyz' ; // this does not work as php looks for a wrong variable, it takes the whole string as the var name.
To be more specific, the array looks like this (the last pair of [] is empty as i'd like to add new members to the array too):
$data = array(
[0] => array( //lets call this one item
'name' => Name,
'attribute' > Attribute,
'items' => array() // here can be x more items containing y more items
To store my current location in the array, I use another one (simple 1D array)
I have been coding for a few years in php data processing apps, but never had to solve this kind of thing :-)
Thanks for any help, if you need more information let me know pls.