I have an PHP array looking like this:
$array['my_data']['value'] = 'some value';
$array['my_own_data']['value'] = 'another value';
$array['different_data']['value'] = 'another value';
I need to use array_merge in PHP or such. The problem is that the number of first level keys are unknown. It could be 150 items, I don't know.
This would not work for me because of the unknown number of keys:
array_merge($array['my_data'], $array['my_own_data'], $array['different_data']);
Do I need a loop or are there something fancy?
array_merge($array['my_data'], $array['my_own_data'], $array['different_data']);
will result into an array containing$array['different_data']['value']
as array_merge will overwrite the array elements with equal key? – Tuition$array
? The keys? The second keys? The values? – Fullfaced...
operator. – Ungracious