I have a database column that stores JSON format strings. The string itself contains multuple elements like an array. Each element contains multiple key-value pairs. Some value may also contain multiple key-value pairs as well, for example, the "address" attribute below.
[{"name":"abc",
"address":{"street":"str1", "city":"c1"},
"phone":"1234567"
},
{"name":"def",
"address":{"street":"str2", "city":"c1"},
"phone":"7145895"
}
]
My ultimate goal is to get the single value of each field within the JSON string. I will probably use explode() to do that but the explode() needs to have arrays passed into it, not a string. So my first goal is to convert the JSON string into an array. Can someone please let me know how to do it ? Many thanks.