I have these two arrays.
$arr1 = array(
[0] => "ABC",
[1] => "DEF",
[2] => "GHI",
);
$arr2 = array(
[0] => 'Y',
[1] => 'N',
[2] => 'Y',
);
And I want to convert these arrays into one JSON object array like below.
[
{ "contents" : "ABC", "open": "Y" },
{ "contents" : "DEF", "open": "N" },
{ "contents" : "GHI", "open": "Y" },
]
I googled it and it suggested me using the json_encode function, but it didn't give me the result I wanted.