public static function safeReadNDArray($array, $keychain, $default = null, $regex = null, &$error = 0)
    {
        if (!is_array($keychain)) {
            return self::safeReadArray($array, $keychain, $default, $regex, $error);
        }
        $headKey = array_shift($keychain);
        if (empty($keychain)) {
            return self::safeReadArray($array, $headKey, $default, $regex, $error);
        }
        $sub_array = self::safeReadArray($array, $headKey, [], null, $error);
        if ($error !== self::REQUEST_NO_ERROR) {
            return $default;
        }
        return self::safeReadNDArray($sub_array, $keychain, $default, $regex, $error);
    }
public static function safeReadNDArray($array, $keychain, $default = null, $regex = null, &$error = 0)
    {
        if (!is_array($keychain)) {
            return self::safeReadArray($array, $keychain, $default, $regex, $error);
        }
        $headKey = array_shift($keychain);
        if (empty($keychain)) {
            return self::safeReadArray($array, $headKey, $default, $regex, $error);
        }
        $sub_array = self::safeReadArray($array, $headKey, [], null, $error);
        if ($error !== self::REQUEST_NO_ERROR) {
            return $default;
        }
        return self::safeReadNDArray($sub_array, $keychain, $default, $regex, $error);
    }
public static function safeReadNDArray ( $ array , $ keychain , $ default = null , $ regex = null , & $ error = 0 ) { if ( ! is_array ( $ keychain ) ) { return self :: safeReadArray ( $ array , $ keychain , $ default , $ regex , $ error ) ; } $ headKey = array_shift ( $ keychain ) ; if ( empty ( $ keychain ) ) { return self :: safeReadArray ( $ array , $ headKey , $ default , $ regex , $ error ) ; } $ sub_array = self :: safeReadArray ( $ array , $ headKey , [ ] , null , $ error ) ; if ( $ error !== self :: REQUEST_NO_ERROR ) { return $ default ; } return self :: safeReadNDArray ( $ sub_array , $ keychain , $ default , $ regex , $ error ) ; }
Safe read ND-Array with keychain
@since 2.0.0 turn to static
@param array $array
@param array $keychain
@param mixed $default
@param null|string $regex
@param int $error
@return mixed|null
Safe read ND - Array with keychain