|
Posted by cc96ai on 07/12/07 17:02
$array1 = array(
array(
"product_id" => 3,
"SKU" => "AES46",
"qty" => 3,
),
);
$array2 = array(
array(
"product_id" => 3,
"SKU" => "AES46",
"qty" => 2,
),
array(
"product_id" => 4,
"SKU" => "AES47",
"qty" => 3,
),
);
I want to add up the qty of two array if the product_id is same
I try on $array1 + $array2, but which is not I want,
I only have to use 2 foreach loop in my mind
foreach ($array1 ...)
foreach ($array2 ...)
if ( id same )
Have other better suggestion or PHP function for this ?
I am using PHP 4.4
[Back to original message]
|