_wp_array_get


_wp_array_get ( $input_array, $path, $default_value = null )

Access:
  • private
Parameters:
  • (array) input_array An array from which we want to retrieve some information.
  • (array) path An array of keys describing the path with which to retrieve information.
  • (mixed) default_value Optional. The return value if the path does not exist within the array, or if `$input_array` or `$path` are not arrays. Default null.
Returns:
  • (mixed) The value from the path specified.
Defined at:

Description

Accesses an array in depth based on a path of keys.It is the PHP equivalent of JavaScript's `lodash.get()` and mirroring it may help other components retain some symmetry between client and server implementations. Example usage: $input_array = array( 'a' => array( 'b' => array( 'c' => 1, ), ), ); _wp_array_get( $input_array, array( 'a', 'b', 'c' ) );

Related Functions

_wp_array_set, wp_cache_get, wp_render_widget, wp_remote_get, wp_kses_array_lc

Top Google Results

User discussions

wpseek mobile