Been staring at this code for most of the afternoon and I'm beginning to be driven up the wall.
Basically I have an array like this:
Array
(
[0] => -11
[1] => -6
[2] => -6
[3] => -5
[4] => -4
[5] => -4
[6] => -2
[7] => -1
[8] => -1
[9] => -1
[10] => -1
[11] => 0
[12] => 1
[13] => 2
[14] => 2
[15] => 3
[16] => 4
[17] => 4
[18] => 5
[19] => 5
[20] => 5
[21] => 6
[22] => 7
[23] => 11
[24] => 64
)
I want to be able to display a position like so
-11 => 1
-6 => 2
-6 => 2
-5 => 4
-4 => 5
-4 => 5
-2 => 7
-1 => 8
-1 => 8
-1 => 8
-1 => 8
0 => 12
1 => 13
2 => 14
2 => 14
3 => 16
4 => 17
4 => 17
5 => 19
5 => 19
5 => 19
6 => 22
7 => 23
11 => 24
64 => 25
and so on.
Anyone got any ideas of an easy way to compute this?