If I have a stdClass object like the one below, which has three arrays with non-numeric keys, what’s the best way to insert another item into the object between my-account and settings?
[menu1] => stdClass Object
(
[my-account] => Array
(
[title] => 'My Account'
)
[settings] => Array
(
[title] => 'Settings'
)
[payments] => Array
(
[title] => 'Payments'
)
)
There’s no function to do this. You’ll have to do your own and rebuild your object
http://sandbox.phpcode.eu/g/fba96/3