I want to join values of array by key to another array. For example, for below input array
[['value', 'element1'],['value', 'element2'], ['value1', 'element1'], ['value', null]]
I would like to have an output
[['value', 'element1', 'element2'], ['value1', 'element1']]
Is there any way to achieve this?