2 つの配列があり、そのキーが最初の配列キーと一致する場合にのみ、2 番目の配列から値のみを抽出したいと考えています。
私の最初の配列は
[deal_id] => Array
(
[0] => Array
(
[0] => 75
[5] => 76
[10] => 77
[15] => 79
)
[1] => Array
(
[0] => 84
)
[2] => Array
(
[0] => 86
[3] => 88
[8] => 89
)
[3] => Array
(
[0] => 97
)
[4] => Array
(
[0] => 100
[4] => 104
)
)
私の2番目の配列は
[package_id] => Array
(
[0] => Array
(
[0] => 10
[1] => 75
[2] => 75
[3] => 75
[4] => 75
[5] => 67
[6] => 34
[7] => 89
[10] => 04
[15] => 75
)
[1] => Array
(
[0] => 10
[1] => 29
[2] => 34
[3] => 45
)
[2] => Array
(
[0] => 12
[3] => 23
[4] => 45
[5] => 76
[6] => 87
[8] => 45
)
[3] => Array
(
[0] => 34
[1] => 54
[2] => 34
)
[4] => Array
(
[0] => 145
[1] => 143
[6] => 146
[4] => 344
)
)
期待される出力:
[package_id] => Array
(
[0] => Array
(
[0] => 10
[5] => 67
[10] => 04
[15] => 75
)
[1] => Array
(
[0] => 10
)
[2] => Array
(
[0] => 12
[3] => 23
[8] => 45
)
[3] => Array
(
[0] => 34
)
[4] => Array
(
[0] => 145
[4] => 344
)
)
キーが最初の配列と一致する 2 番目の配列の値のみが必要です。値を除いて、2 番目の配列を最初の配列とまったく同じに見せたいと思います。
ありがとう