You can't do what you want because you will only replace the current array item value with each repeated key. But what you are trying to achieve is inline with the below code. Your keys have to be unique. It's how you fetch data from the array. They are your unique identifiers.
Here's an array :
array(
"a" => "82",
"b" => "32",
"c" => "23",
"d" => "21",
"e" => "67"
);
You need to unset the array item and then you can set it in the array with the new key. (Heads Up! This is very inefficient. You should just build your array how you want it without using dupe keys.)
Here's how you append onto each key in the array :
$i = 1;
foreach ($array as $key => $value) {
unset($array[$key]);
$array[$key . "_" . $i] = $value;
$i++;
}
print_r($array);
Output :
array(
[a_1] => 82
[b_2] => 32
[c_3] => 23
[d_4] => 21
[e_5] => 67
);