I don't know why, but I am having a heckuva time wrapping my brain around making the final output array itself, so...
I am going to give you a function I wrote that will echo the results as you want them to appear, but as far as the array part is concerned, I am still working that one out in my head.
$array = Array(-11, -6, -6, -5, -4, -4, -2, -1, -1, -1, -1, 0, 1, 2, 2, 3, 4, 4, 5, 5, 5, 6, 7, 11, 64);
function placement($array){
$counttotal = count($array);
for($i = 1; $i <= $counttotal; ){
echo $array[$i-1]." => ";
if((@$array[$i-1] != @$array[$i-2])){
echo $i."<br />";
} else {
echo ($i-1)."<br />";
}
$i++;
}
}
placement($array);
I hope this helps you a bit, and when I figure out how to make the output array, I will repost. (P.S. The output array will have to be multidimensional so as to not try to create duplicate indexes.)