У меня есть два красноречивых выхода
allowance Amount
A 100
B 80
C 120
D 150
И
Deductions Amount
X 50
Y 60
Z 70
и json отображается как
$allowance = [{"allname":"A","allamount":"100"},{"allname":"B","allamount":"80"},{"allname":"C","allamount":"120"},{"allname":"D","allamount":"150"}]
$Deductions = [{"dedname":"X","dedamount":"50"},{"dedname":"Y","dedamount":"60"},{"dedname":"Z","dedamount":"70"}].
Я хочу, чтобы новый JSON был похож на
$new = [{"allname":"A","allamount":"100","dedname":"X","dedamount":"50"},{"allname":"B","allamount":"80","dedname":"Y","dedamount":"60"},{"allname":"C","allamount":"120","dedname":"Z","dedamount":"70"},{"allname":"D","allamount":"150"}]
Пожалуйста, ведите меня. Заранее спасибо.