This is the return result of my two variables:
$resultPayment = [
[72875500, 8187000],
[14343],
[44419200,
["12332000"],
[28700250]
]
$resultId = [
["461", "462"],
[6462],
[8771],
[8461],
[5461]
]
This is the code for get the data:
for ($iii=0; $iii<count($dataInvoice); $iii++) {
$resultId[] = unserialize($dataInvoice[$iii]->invoiceid);
$resultPayment[] = unserialize($dataInvoice[$iii]->jumlahbayarid);
}
These two pieces of data are the same length and array structure, and I want to combine $id and $payment and create an object. Here are the results I expect :
[
{ "461": 72875500 },
{ "462": 8187000 },
{ 6462: 14343 },
{ 8771: 44419200 },
{ 8461: "12332000" },
{ 5461: 28700250 }
]
"461","462",6462, ...)?