I have an php array like:-
Array
(
[colors] => Array
(
[0] => white
[1] => Yellow
[2] => Black
[3] => white
[4] => Array
(
[0] => white
[1] => Black
)
[5] => Array
(
[0] => white
[1] => Black
)
[6] => white
[7] => red
)
)
Now I want Output like:
Array
(
[colors] => Array
(
[0] => white
[1] => Yellow
[2] => Black
[3] => white
[4] => white
[5] => Black
[6] => white
[7] => Black
[8] => white
[9] => red
)
)
Means if array element has array value then it will be moved to parent. I don't want child layer. Please suggest how can I achieve