XpertWorlock Posted September 15, 2010 Share Posted September 15, 2010 Let's say I have the following JSON object : ({"test":{"status":"good"}}) Now how would I add "test2" to make it : ({"test":{"status":"good"}, "test2":{"status":"bad"} }) Thanks for any help Quote Link to comment https://forums.phpfreaks.com/topic/213448-add-new-value-to-json-object/ Share on other sites More sharing options...
trq Posted September 15, 2010 Share Posted September 15, 2010 obj.test2 = { status: 'bad' } Quote Link to comment https://forums.phpfreaks.com/topic/213448-add-new-value-to-json-object/#findComment-1111228 Share on other sites More sharing options...
XpertWorlock Posted September 15, 2010 Author Share Posted September 15, 2010 I knew it was something simple but the ol brain wasn't thinking. Quote Link to comment https://forums.phpfreaks.com/topic/213448-add-new-value-to-json-object/#findComment-1111229 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.