function idxv($map, $path, $default)libphutil Technical Documentation (Core Utilities)
function idxv($map, $path, $default)
libphutil Technical Documentation (Core Utilities)
Access a sequence of array indexes, retrieving a deeply nested value if it exists or a default if it does not.
For example, idxv($dict, array('a', 'b', 'c')) accesses the key at $dict['a']['b']['c'], if it exists. If it does not, or any intermediate value is not itself an array, it returns the defualt value.
Parameters
array | $map | Array to access. |
list<string> | $path | List of keys to access, in sequence. |
wild | $default | Default value to return. |
Return
wild | Accessed value, or default if the value is not accessible. |
- Defined
- src/utils/utils.php:64