PHP: How to retrieve the parent array dimension having child -
i want create function pass parameter array "position", this:
function f($pos){}; f($people[all][person][name]);
then want retrieve parent dimension of array, want have $people[all]
. way foreach cycle on person.
my idea function pass position , function sort "parent" dimension position given.
common case:
$people[men][person][name]=>value f($people[men][person][name])
will sort men name.
how that?
how
function f($pos){ foreach ($people[all][person] $name){ echo $name; } } f($people);
this name
Comments
Post a Comment