I am using an array like this for a static file cache:
[
key => data => [
key1 => data => [...]
=> expires => 123456
key2 => data => [...]
=> expires => 123456
]
=> expires => 123456
]
This can be many levels deep (sometimes 10-15 levels).
What I would like to do is return only the values of data, so for instance, to create an array like so
[
key => key1 => [...]
=> key2 => [...]
]
how would I do this?
EDIT
print_r of the structure
Array (
[key] =>
Array (
[data] =>
Array (
[key1] =>
Array (
[data] => Array ( ... )
[expires] => 12345678)
[key2] =>
Array (
[data] => Array ( ... )
[expires] => 12345678
)
)
[expires] => 12345678
)
)
You can use recursive function like this:
It will work on array structure like this:
This is the result of the var_dump() hope meets your requirement: