This question already has an answer here:
I am using json_encode() to encode array into json format. but it returning object instead of array. I want to return an array not an object. any body have any idea?
This question already has an answer here: I am using json_encode() to encode array into json format. but it returning object instead of array. I want to return an array not an object. any body have any idea? |
|||||
|
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
You should use
Now | |||||
|
Basically json_decode() will return data two types.
By default json_decode() return object type value. But, if you want value as an array format use must use e.g,
| |||
|
use this code for decoding your encode json data
| |||
|
actually json_encode function in php will return a json formatted string. and if you want to parse json formatted string back in php then you should use json_decode. json_decode function will return data two types. object & associtavie array. json_decode(); return type object json_decode(, TRUE); return type associtative array | ||||
|