_wp_array_get


_wp_array_get ( $array, $path, $default = null )

Access:
  • private
Parameters:
  • (array) 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 The return value if the path does not exist within the array, or if `$array` or `$path` are not arrays.
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: $array = array( 'a' => array( 'b' => array( 'c' => 1, ), ), ); _wp_array_get( $array, array( 'a', 'b', 'c' );

Related Functions

wp_cache_get, wp_kses_array_lc, wp_remote_get, wp_array_slice_assoc, wp_star_rating

Top Google Results

User discussions

wpseek mobile