A Bit later, but… hope helps someone:
// $pathStr = "an:string:with:many:keys:as:path";
$paths = explode(":", $pathStr);
$itens = $myArray;
foreach($paths as $ndx){
$itens = $itens[$ndx];
}
Now itens is the part of the array you wanted to.
[]’s
Labs
More Related Contents:
- how can i passed array into a function in php [closed]
- Needle in a Haystack for Php [closed]
- Multiple inputs with same name through POST in php
- Creating one array from another array in php [closed]
- Filter array by its keys using an array of allowed keys
- How to echo or print an array in PHP?
- Reference – What does this error mean in PHP?
- Count number of values in array with a given value
- Which is faster in PHP, $array[] = $value or array_push($array, $value)?
- Difference between method calls $model->relation(); and $model->relation;
- array_unique for objects?
- String with array structure to Array [duplicate]
- Checking if all the array items are empty PHP
- Get week number in month from date in PHP?
- Display array values in PHP
- How can I force PHP to use strings for array keys? [duplicate]
- Create a comma-separated string from a single column of an array of objects
- How to filter an associative array comparing keys with values in an indexed array?
- Rotate array elements to the left (move first element to last and re-index)
- Grouping arrays in PHP
- Group 2d array data using column value to create a 3d array
- While destructuring an array, can the same element value be accessed more than once?
- Concatenate values of n arrays in php
- How to convert array to a string using methods other than JSON?
- How to insert json array into mysql database
- Why do I get “Resource id #4” when I apply print_r() to an array in PHP? [duplicate]
- How to set an option from multiple options or array with different values to views as selected in select box using PHP
- Push item to associative array in PHP
- PHP Spread Syntax in Array Declaration
- Implementing a simple lookup array