I have an array not too different from the below (with a lot more sub-arrays). There are any number of sub-arrays and any level of arrays below them. It's only ever this many levels deep however.
Let's say I wanted to bring back all unique pets (in [1]) how would go about doing that? Similarly, if I wanted all unique colours (in [2]) or all unique cars [in [3]]
I tried solutions from How to remove duplicate values from a multi-dimensional array in PHP and other similar SO pages but got nowhere fast and now back to a blank page
Any advice?
Array
(
[0] => Array
(
[0] => Array
(
[0] => Jo Bloggs
[1] => Cat
[2] => Red
[3] => Nissan
)
[1] => Array
(
[0] => Patrick
[1] => Dog
[2] => Blue
[3] => Nissan
)
)
[1] => Array
(
[0] => Array
(
[0] => Charloe
[1] => Moose
[2] => Green
[3] => Ford
)
[1] => Array
(
[0] => Patrick
[1] => Dog
[2] => Blue
[3] => Porsche
)
)
...