Всем доброго времени!
Подскажите, как можно решить задачу:
есть динамический массив в котором иногда сливается ноль и цифра след. ключа. Необходимо в таких случаях находить этот ключ массива и переносить цифру в следующий массив со смещением вперед остальных ключей.
Например массив, ключи 11 и 42
spoilerarray (
[0] => 7 (70%),
[1] => 1 (100%),
[2] => 2,1,
[3] => 2,
[4] => 1,1,
[5] => 1,
[6] => 5 (33,3%),
[7] => 1 (100%),
[8] => 1,5,
[9] => 1,
[10] => 1,
[11] => 05 (83,3%),
[12] => 0 (0%),
[13] => 0,6,
[14] => 1,
[15] => 0,1,
[16] => 1,
[17] => 3,2,
[18] => 7,
[19] => 2,9,
[20] => 7,
[21] => 1,
[22] => 1,
[23] => 8,7,
[24] => 7,
[25] => 2,1,
[26] => 4,
[27] => 17,3,
[28] => 25,
[29] => 17,5,
[30] => 16,
[31] => 89,5,
[32] => 93,
[33] => 46,6,
[34] => 68,
[35] => 2,3,
[36] => 2,
[37] => 4,6,
[38] => 2,
[39] => 12,6,
[40] => 8,
[41] => 20,
[42] => 040,
[43] => 43,
[44] => 1
);
Необходим результат:
spoilerarray (
[0] => 7 (70%),
[1] => 1 (100%),
[2] => 2,1,
[3] => 2,
[4] => 1,1,
[5] => 1,
[6] => 5 (33,3%),
[7] => 1 (100%),
[8] => 1,5,
[9] => 1,
[10] => 1,
[11] => 0,
[12] => 5 (83,3%),
[13] => 0 (0%),
[14] => 0,6,
[15] => 1,
[16] => 0,1,
[17] => 1,
[18] => 3,2,
[19] => 7,
[20] => 2,9,
[21] => 7,
[22] => 1,
[23] => 1,
[24] => 8,7,
[25] => 7,
[26] => 2,1,
[27] => 4,
[28] => 17,3,
[29] => 25,
[30] => 17,5,
[31] => 16,
[32] => 89,5,
[33] => 93,
[34] => 46,6,
[35] => 68,
[36] => 2,3,
[37] => 2,
[38] => 4,6,
[39] => 2,
[40] => 12,6,
[41] => 8,
[42] =>20,
[43] => 0,
[44] => 40,
[45] => 43,
[46] => 1
);