- name of array from string variable
- sequence of indexes of array from string variable
- Code: Select all
$arr[1][2]="correct array value";
$arr_name="arr";
$arr_idx="[1][2]";
Next code works, but it's not I want get:
- Code: Select all
echo 'example 1 = ('.${$arr_name}[1][2].')';
What I want is:
- Code: Select all
// it doesn't return value:
echo 'example 2 = ('.${$arr_name}[$arr_idx].')';
// it doesn't return value too:
echo 'example 3 = ('.${$arr_name.$arr_idx}.')';
Somebody knows how to achieve effect returning correct value? I need help.
Thanks.

