<?php
$array1 = '[{
"product_name": "Product1",
"qty": "1"
},
{
"product_name": "Product2",
"qty": "2"
},
{
"product_name": "Product3",
"qty": "3"
}]';
$array2 = '[{
"product_name": "Product4",
"qty": "1"
},
{
"product_name": "Product3",
"qty": "1"
},
{
"product_name": "Product2",
"qty": "1"
}]';
$arr1 = json_decode($array1, true);
var_export($arr1);
$arr2 = json_decode($array2, true);
$result = array_merge($arr1,$arr2);
var_export($result);
preferences:
52 ms | 402 KiB | 5 Q