I need to replace all values in a multidimensional array by their respective key, but only if the value is not an array.
From:
array(
'key1' => array(
'key2' => array(
'key3' => 'val'
)
)
);
To:
array(
'key1' => array(
'key2' => array(
'key3'
)
)
);
Does anyone know a way to do this nicely?