我希望合并两个数组,以便名称和值可以并排。
我有此代码:$mgl = array(
'200101',
'200201',
'200202'
);
$mpro = array(
'Current Account',
'Regular Saving Account',
'Ileya Target'
);
array_push($response, array(
"glno"=>$mgl,
"product"=>$mpro
));
echo json_encode(array("server_response"=> $response));
当我查看它时,它是这样显示的:{“ server_response”:[{“ glno”:[“ 200101”,“ 200201”,“ 200202”],“产品”:[“当前帐户”,“常规储蓄帐户”,“ Ileya目标”]}]}]
我想要这种格式{"server_response":[
{"glno":"104100","product":"Micro Loans"},
{"glno":"200101","product":"Current Account"},
{"glno":"200201","product":"Regular Saving Account"}
]}