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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -