Hi.. i want to convert this array
Array
(
[2] => Array
(
)
[4] => Array
(
[12] => Array
(
)
[13] => Array
(
[16] => Array
(
)
)
)
[5] => Array
(
)
[10] => Array
(
)
[14] => Array
(
)
)
into this format
Array
(
[2] => 2
[4] => Array
(
[0] => 12
[13] => Array
(
[0] => 16
)
)
[5] => 5
[10] => 10
[14] => 14
)
can anybody help? thanks. [continued 16Mar2010]
its not
[2] =>array
but
[2] => 2
if it is an array with 1 child or more, then it would be [4] => Array([12]=>12
input data is
$a = array(2 => array(), 4 => array(12 => array(), 13 => array(16 => array())), 5 => array(), 10 => array(), 14 => array());