Assume I have arrays like:
$arr['foo']['bar']['test'] = 'value';
$arr['noo']['boo'] = 'value';
$arr['goo'] = 'value';
$arr['hi'][] = 'value'; // $arr['hi'][0]
$arr['hi'][] = 'value2'; // $arr['hi'][1]
I need to convert this, to:
$arr['foo[bar][test]'] = 'value';
$arr['noo[boo]'] = 'value';
$arr['goo'] = 'value';
$arr['hi[0]'] = 'value';
$arr['hi[1]'] = 'value2';
I have tried writing a recursive function, though it seems I have a lack of logic for it. I appreciate help writing this code.
Many people keep asking why I need this? Well.. it is for my form class and I find it pretty useful there.