MoFish Posted October 11, 2014 Share Posted October 11, 2014 Hi, I'm getting the following response using: $json_object = json_decode($unparsed_json, true); array(1) { ["google.com"]=> array(2) { ["status"]=> string(16) "regthroughothers" ["classkey"]=> string(6) "domcno" } } How do I echo the attribute of the ['status']? I have tried using: echo $json_object->['status']; Thanks, MoFish Quote Link to comment https://forums.phpfreaks.com/topic/291571-json-response-how-to-read-value/ Share on other sites More sharing options...
Solution Ch0cu3r Posted October 11, 2014 Solution Share Posted October 11, 2014 Use $json_object['google.com']['status']; instead $json_object is a multidimensional array not an object. 1 Quote Link to comment https://forums.phpfreaks.com/topic/291571-json-response-how-to-read-value/#findComment-1493318 Share on other sites More sharing options...
MoFish Posted October 12, 2014 Author Share Posted October 12, 2014 Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/291571-json-response-how-to-read-value/#findComment-1493388 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.