How could I move all nodes of the ‘fields’ array into its parent array ‘113’, whilst unsetting ‘fields’ ?
[a] => Array
(
[113] => Array
(
[title] => asdfasdfas
[alias] => asdfasdfas
[fields] => Array
(
[jr_streetaddress] => Array
(
[type] => text
[label] => Street Address
[data] => asdfasdffsd
)
[jr_towncity] => Array
(
[type] => text
[label] => Town / City
[data] => Nottingham
)
)
)
)
Assuming your top level array (
$something['a']) is the variable$a:Alternatively, if you dont want to hit every array element in
$ayou can just remove the loop and substitute$valueswith$a[113]and$keywith113.Also note the casting for the fields element to an array, jsut in case it isnt one with
(array) $values['fields']