I am getting the response from an API mentioned below, I have been trying to convert the below data into a JSON array, but I am not able to convert it.
found=100
items[0].Detail.Address=192.168.1.4
items[0].Detail.Type=CGI
items[0].Device=
items[0].Level=0
items[0].Time=2022-09-15 11:10:12
items[0].Type=Log In
items[0].User=admin
items[1].Detail.Address=192.168.1.4
items[1].Device=
items[1].Level=0
items[1].Time=2022-09-15 11:09:37
items[1].Type=Log Out
items[1].User=admin
I want to convert this data into an Array of JSON.
The expected result:
[
{
"Detail": {
"Address": "192.168.1.4",
"Type": "CGI"
},
"Device": "",
"Level": 0,
"Time": "2022-09-15 11:10:12",
"Type": "Log In",
"User": "admin"
},
{
"Detail": {
"Address": "192.168.1.4"
},
"Device": "",
"Level": 0,
"Time": "2022-09-15 11:09:37",
"Type": "Log Out",
"User": "admin"
}
]