同じ参照番号で製品を合計したいのですが、寸法などの 3 番目のパラメーター (...、24、26mm、...)があり、同じ寸法の場合にのみこの値を合計することはできません。私はこれを試しました:特定の値で多次元配列をグループ化しますか? しかし、どのように値を合計するのですか? 私の配列は次のようになります。
Array
(
[0] => Array
(
[0] => 2
[1] => 790180X
[2] => 26mm
)
[1] => Array
(
[0] => 4
[1] => 762182Z
)
[2] => Array
(
[0] => 2
[1] => 072182X
)
[3] => Array
(
[0] => 4
[1] => 660122Y
)
[4] => Array
(
[0] => 2
[1] => 790180X
[2] => 24mm
)
[5] => Array
(
[0] => 1
[1] => 225160Y
)
[6] => Array
(
[0] => 1
[1] => 244160Y
)
[7] => Array
(
[0] => 1
[1] => 225160Y
)
[8] => Array
(
[0] => 8
[1] => 954120Y
)
[9] => Array
(
[0] => 3
[1] => 072182X
)
)
私はこのようなことをしたい:
Array
(
[0] => Array
(
[0] => 2
[1] => 790180X
[2] => 26mm
)
[1] => Array
(
[0] => 2
[1] => 790180X
[2] => 24mm
)
[2] => Array
(
[0] => 4
[1] => 762182Z
)
[3] => Array
(
[0] => 5
[1] => 072182X
)
[4] => Array
(
[0] => 4
[1] => 660122Y
)
[5] => Array
(
[0] => 2
[1] => 225160Y
)
[6] => Array
(
[0] => 1
[1] => 244160Y
)
[7] => Array
(
[0] => 8
[1] => 954120Y
)
)
短いバージョンの配列:
Array => TO => Array
( (
[0] => 2:790180X:26mm [0] => 2:790180X:26mm
[1] => 4:762182Z [1] => 2:790180X:24mm
[2] => 2:072182X [2] => 4:762182Z
[3] => 4:660122Y [3] => 5:072182X
[4] => 2:790180X:24mm [4] => 4:660122Y
[5] => 1:225160Y [5] => 2:225160Y
[6] => 1:244160Y [6] => 1:244160Y
[7] => 1:225160Y [7] => 8:954120Y
[8] => 8:954120Y )
[9] => 3:072182X
)