Scenario (example):
I have 2 Arrays
, X and Y (dynamically created, individual ):
$arX = Array('AAA' => 173.696, 'BBB' => 72.436, 'CCC' => 142.692);
$arY = Array('AAA' => 127, 'DDD' => 72.333);
Objective:
What you would like is to join them by key, but separate values .
Example of the expected result:
Array
(
[AAA] => Array
(
[X] => 173.696,
[Y] => 127
)
[BBB] => Array
(
[X] => 72.436
)
[CCC] => Array
(
[X] => 142.692
)
[DDD] => Array
(
[Y] => 72.333
)
)
Questions:
- Is there a native function for this?
- How could I get the result?