GetArrKey

The Responsive Minimal GetArrKey function.

Description

GetArrKey( $findArr, $key_arr, (int) $depth = 0 ); 

Parameters (3)

0. $findarr
The findArr.
1. $key_arr
The key arr.
2. $depth — Optional. (int)
The depth.

Usage

  1. if ( !function_exists( 'GetArrKey' ) ) { 
  2. require_once '/functions/layout_callback.php'; 
  3.  
  4. // The findArr. 
  5. $findarr = null; 
  6.  
  7. // The key arr. 
  8. $key_arr = null; 
  9.  
  10. // The depth. 
  11. $depth = -1; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = GetArrKey($findarr, $key_arr, $depth); 
  15.  

Defined (1)

The function is defined in the following location(s).

/functions/layout_callback.php  
  1. function GetArrKey( $findArr, $key_arr, $depth=0 ) { 
  2. if( count($key_arr) <= $depth || !array_key_exists($key_arr[$depth], $findArr) ) 
  3. return NULL; 
  4. else if( count($key_arr) == $depth+1 ) 
  5. return $findArr[$key_arr[$depth]]; 
  6.  
  7. return self::GetArrKey( $findArr[$key_arr[$depth]], $key_arr, $depth+1 );