I have an associative array like follow
Array ( [1274] => 2 [2700] => 3 [2701] => 4 [2702] => 2 [2699] => 2 [2698] => 1 [2694] => 1......)
what i want is to take the first 10 elements from this array. I Used array_slice
. But then the new array will be like
Array ( [0] => 2 [1] => 3 [2] => 4 [3] => 2 [4] => 2 [5] => 1 [6] => 1.....)
It limits the array but array keys have been removed. How can i get the keys as well? Thanks for your advices.