I have a JSON object that looks something like so:
$jsonObj = {
"groups": {
"first" : {...},
"second: {
"Old Name" : {...},
"others": {...}
},
"third": {...}
}
};
I want to change the property name "Old Name"
to "New Name"
but keep it as first property in its parent ("second"
). Is it possible to achieve it?
(of course I can assign a new property to "second"
and unset the old one but that will position it at the end of the object and that's not the result I'm looking for).