Hello!
Tell me, please, in the direction of what to look for. task.
There is a multidimensional array of the form (it is possible to generate separate arrays, but their number can be different - probably, in multidimensional it will be easier to process):
Array ( [0] => Array ( [0] => Name 1 [1] => 1 [2] => 0 [3] => 7 ) [1] => Array ( [0] => Name 2 [1] => 1 [2] => 0 [3] => -10 ) [2] => Array ( [0] => Name 3 [1] => 0 [2] => 1 [3] => 6 ) [3] => Array ( [0] => Name 4 [1] => 0 [2] => 1 [3] => -11 ) [4] => Array ( [0] => Name 1 [1] => 1 [2] => 0 [3] => 10 ) [5] => Array ( [0] => Name 3 [1] => 0 [2] => 1 [3] => 7 ) ) It is required to combine arrays with identical keys [0]. Those. combine the names, with the values of all the other keys added together.
The output should get the result, for example:
[0] => Array ( [0] => Name 1 [1] => 2 [2] => 0 [3] => 17 ) [1] => Array ( [0] => Name 2 [1] => 1 [2] => 0 [3] => -10 ) ... An attempt was made to proceed from the solution: https://toster.ru/q/60856 - but then it is possible to create a new array, without copies of the names (i.e., the key [0] is combined), but the other keys cannot be combined.
What method to remove copies (connect by key [0]), so that the keys [1] [2] [3] from duplicates are combined - I find it difficult to understand.