I have following object:
{"2":{"cid":"2","uid":"2"},"1":{"cid":"1","uid":"3"}}
In this example I want to remove
"1":{"cid":"1","uid":"3"}
from it.
I have tried all solutions that I found on Stack Overflow, and could not make any of them work. I am mostly PHP person, so I might miss something important here?
Just use
deletewith the appropriate property.Note the
"around the 1 to mark it as an identifier and not as an array index!EDIT
As pointed out in the comment,
objis an object and no array no matter how you address the[1]property. My last note was just to make it clear that you are working with an object and not an array.In my experience most people associate integer properties with arrays and string properties with objects. So I thought it might be more helpful to highlight the property in the way given.