lib/SBLib/Utilities/MISC.php
public static function findKey($aKey, $array) {
        // Check if an array is provided.
        if (is_array($array)) {
            // Loops through the array.
            foreach ($array as $key => $item) {
                // Checks if it did find the matching key. If it doesn't, it continues looping until it does,
                // or until the end of the array.
                if ($key == $aKey) {
                    return $item;
                } else {
                    $result = self::findKey($aKey, $item);
                    if ($result != false) {
                        return $result;
                    }
                }
            }
        }
        return false;
    }
public static function findKey($aKey, $array) {
        // Check if an array is provided.
        if (is_array($array)) {
            // Loops through the array.
            foreach ($array as $key => $item) {
                // Checks if it did find the matching key. If it doesn't, it continues looping until it does,
                // or until the end of the array.
                if ($key == $aKey) {
                    return $item;
                } else {
                    $result = self::findKey($aKey, $item);
                    if ($result != false) {
                        return $result;
                    }
                }
            }
        }
        return false;
    }
public static function findKey ( $ aKey , $ array ) { // Check if an array is provided. if ( is_array ( $ array ) ) { // Loops through the array. foreach ( $ array as $ key => $ item ) { // Checks if it did find the matching key. If it doesn't, it continues looping until it does, // or until the end of the array. if ( $ key == $ aKey ) { return $ item ; } else { $ result = self :: findKey ( $ aKey , $ item ) ; if ( $ result != false ) { return $ result ; } } } } return false ; }
in the array the key is, just that it exists in there somewhere.
in the array the key is just that it exists in there somewhere .