I have an array in a PHP class and two member functions
First one receives two integers, one is the dimension and the other is the value:
private $complexArray;
function setValueToGivenDimension($dimension, $value)
What I want to do is to set the value to the given dimension of the array.
For example, If I call the function as the following:
setValueToGivenDimension(3,"key","myValue")
I want the array to be
array [
0 => array [
0 => array [
"key" => "myValue"
]
]
]
And Second is function getValueOfGivenDimension($dimension, $key)
For example, If I call the function as the following:
getValueOfGivenDimension(3,"key")
It should return value of the given key which is 0 in this case of the 3rd dimension of the $complexArray:
"myValue"
*array can have any level of dimension and I want to create and index dimensions of the array dynamically.