Hi guys and gals,
I am having great difficulties with getting hold of the last 10 elements (maintaining key associations) of a multidimensional associative array.
$myArray["key"] = array(12,81);
Meaning the array format is;
array{
["key"] =>
array{
[0]=>"12"
[1]=>"81"
}
}
I need to get hold of the last 10 elements of the array, with the key=>val maintained. This means I cannot do this;
array_slice ($myArray, count($myArray)-10,10);
As the indices are lost??
I also tried uising arsort, and then using a conditional for each loop, with a manual counter,
however it sorted on the incorrect array element. Im tearing my hair out, any suggestions?