How could I get the keys from a dynamic multidimensional arrays those I randomized them using Shuffle function?
Assume that I have this script:
function customShuffle(array &$array) {
$firstElement = array_shift($array);
shuffle($array);
array_unshift($array, $firstElement);
}
$array = array(
'row_1' => array("Bird", "Brown", "Bear", "Bangkok", "Bat"),
'row_2' => array("Carrot", "Cat", "Crispy", "Cross", "Cable"),
'row_3' => array("All", "Apple", "Adam", "Apart", "Air")
);
array_walk($array, function (&$array) { customShuffle($array); });
Shuffle($array);
That script would give me a shuffled arrays vertically and shuffled elements in each array.
I tried to use array_keys function, but it keep giving me the main array keys only!
What I need is to get the dynamic keys for every element in every sub array, as well as the keys of the dynamic arrays in the first level, how could I do that, please?