Yes, I redirected to simpler solution
Btw, the original problem was:
a function read a php array from a file. the function does not know the array' structure. In the file could be, i.e:
$foo['a1']='alfa';
$foo['a1']='beta';
$foo['a2']='pi';
$foo['a2']='ro';
$foo['a2']='sigma';
$foo['a3']='x';
$foo['a3'][0]='y';
$foo['a3'][1]='z';
In all the solution discussed, an array name and an item name is given in input to the function, through two separate variables: so, the function is required to know how to compose the input tokens in something matching the array in the file. Here is the problem.
If I set one only variable this way (i.e.):
then I can call the function this way:
and I could have the function easily returning:
without the foofunction knowing the array structure in the file, if $a could be evaluated as a variable name....