Is it possible to cut multiple dimensions in a php array?
example:
I want the 4th dimension of each first-level element
array(1) {
[0]=> array(5)
{
[0]=> string(_) "/opt/path [10823] (/home/path/file.xml)"
[1]=> string(_) "/opt/path"
[2]=> string(_) "10823"
[3]=> string(_) "(/home/path/file.xml)"
[4]=> string(_) "/home/path/file.xml"
}
}
=>
array(1){ ( [0]=> string(_) "/home/path/file.xml") }
is there an internal php function or a way to achieve this without a loop?
Use array_map :
You could alse do the same with array_walk, which directly edit your array instead of creating a new one.