I have this array, how can I put same toote_id values together so that toote_id[0] and toote_id[3] are the same (when printing out).
Then for them the price (toote_hind" should be also the same -> toote_hind[0] + toote_hind[3]
And now the amount "toote_hulk" should be toote_hulk[0] + toote_hulk[3]
how to do that?
Array (
[ostmine] => Array
(
[toote_id] => Array ( )
[toote_hind] => Array ( )
[toote_hulk] => Array ( )
[toote_kood] => Array ( )
[ostetud] => 1
)
[toote_id] => Array
(
[0] => 19
[1] => 16
[2] => 1
[3] => 19
[4] => 3
)
[toote_hind] => Array
(
[0] => 209
[1] => 99
[2] => 500
[3] => 209
[4] => 69.95
)
[toote_hulk] => Array
(
[0] => 6
[1] => 9
[2] => 1
[3] => 2
[4] => 8
)
[toote_kood] => Array
(
[0] => u1a257p3r299g2o991Q1r4P2o7E17939
[1] => r2W582n1u1y4R5Y461w4q371017279w3
[2] => 92r6q6o219z218h1w914n5590143n4v4
[3] => R1o1r189z2h1p532r932t7w68699W6F2
[4] => a2q1v9g1b912z1u68277c5s4P2q9q7h7
)
)
Then for them the price (toote_hind" should be also the same -> toote_hind[0] + toote_hind[3]
And now the amount "toote_hulk" should be toote_hulk[0] + toote_hulk[3]
how to do that?
Array (
[ostmine] => Array
(
[toote_id] => Array ( )
[toote_hind] => Array ( )
[toote_hulk] => Array ( )
[toote_kood] => Array ( )
[ostetud] => 1
)
[toote_id] => Array
(
[0] => 19
[1] => 16
[2] => 1
[3] => 19
[4] => 3
)
[toote_hind] => Array
(
[0] => 209
[1] => 99
[2] => 500
[3] => 209
[4] => 69.95
)
[toote_hulk] => Array
(
[0] => 6
[1] => 9
[2] => 1
[3] => 2
[4] => 8
)
[toote_kood] => Array
(
[0] => u1a257p3r299g2o991Q1r4P2o7E17939
[1] => r2W582n1u1y4R5Y461w4q371017279w3
[2] => 92r6q6o219z218h1w914n5590143n4v4
[3] => R1o1r189z2h1p532r932t7w68699W6F2
[4] => a2q1v9g1b912z1u68277c5s4P2q9q7h7
)
)
Kommentar