Will attempt to fetch a specific value from a multidimensional array.
Parameters
$root
arrayrequired$keys
arrayrequired$default_value
mixedoptional- A default value which is used as a fallback.
Default:
null
Source
final protected function multidimensional_get( $root, $keys, $default_value = null ) {
if ( empty( $keys ) ) { // If there are no keys, test the root.
return isset( $root ) ? $root : $default_value;
}
$result = $this->multidimensional( $root, $keys );
return isset( $result ) ? $result['node'][ $result['key'] ] : $default_value;
}
Changelog
Version | Description |
---|---|
3.4.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.