I have a JSON String. I want it to be filled in Array. Here is Array which i receive.
My JSON Response is:
{
"model": "SyncData",
"unique_id": "c12fb356f90d032b",
"key": "sdjvnsdivbsnd",
"sync_data": {
"array_a": [{
"a_fav": "true",
"a_id": 1
}, {
"a_fav": "false",
"a_id": 2
}],
"array_b": [{
"b_fav": "false",
"b_id": 8
}],
"c_array": [{
"c_fav": "false",
"c_id": 15996
}],
"patient_list_array": [{
"unique_id": "sdvsdvsdvdsdv",
"p_status": "false",
"p_id": 1454943805215,
"p_note": "2",
"p_code": "8",
"p_timestamp": 1454943805216,
"p_name": "ABC XYZ",
"p_status": 1,
"p_room_no": "5"
}],
"array_d": [{
"d_assigned_id": "30",
"d_fav": "true"
}]
}
}
I want to store all this data in Array and from that in DataBase.
json_decode($string, true)also this is an object, which contains other properties that are arrays. I suggest you leave it as an object so dont use the second parameter i.e.,true