I am trying to assign values of array by dynamic name I am trying following
$arr = array();
$path = 'arr'."['item']['abc']";
${$path} = array(
'name'=>'somename',
'other'=>'...'
);
isn't ${$path} => $arr['item']['abc'];
also I tried $$path which should evaluated as $arr['item']['abc']; but none of them working
http://codepad.viper-7.com/Dc8Jei
Updated -> http://codepad.viper-7.com/k4sIgJ
What I am trying to do is store files and folder in array I have directory structure like this
(this is amazon aws s3 object keys)
aaa/aaab/
aaa/a.png
aaa/abc/one.png
abb/a/
abb/some/
abb/some/ac.png
now what I am trying to do is store those items in array
I broke down those keys into this string like
['aaa']['abc']
now what I want to get is
[aaa]{
[aaab]{}
[abc]{
[0]{one.png}
}
[aaab]{}
}
its just for illustration
$arr ['item']['abc']but I can not have it static['item']as the first array subscript as in the codepad, or could that change? etc etc.