Recursive array keys replacement

paavalan

New Member
I have quite big recursive array with mixed numeric and string keys.Which is the fastest way to replace the numeric keys with string keys (prefix each numeric with \[code\]item_\[/code\])?eg.\[code\]array('key_1' => 'val1', 2 => array( 3 => 'val3'));\[/code\]to\[code\]array('key_1' => 'val1', 'item_2' => array('item_3' => 'val3'));\[/code\]I want the order of the items remain the same.
 
Back
Top