Possible Duplicate:
PHP Walk through multidimensional array while preserving keys
I have a deep array like this one:
array {
["key1"] => "A"
["key2"] => "B"
["key3"] => array {
["subkey1"] => "C"
["subkey2"] => array {
["subsubkey1"] => "D"
}
}
}
I don’t know how deep this array will get.
Now I want to convert it to an array that looks like this:
array {
array {
["key1"] => "A"
["key2"] => "B"
["key3.subkey1"] => "C"
["key3.subkey2.subsubkey1"] = > "D"
}
How would I do that? I guess it needs a recursion?
As simple as
http://ideone.com/ieSZ6
PS: usually I don’t like to give complete solutions, but in this case – the solution might be too difficult for newbie