K2hdkc::getValue K2hdkc Class K2hdkc::casDecrement

K2hdkc::addSubkey

Associates the key with the other key

Description

    public function addSubkey(
        string $key,
        string $subkey,
        string $subval,
        bool $check_attr = true,
        string $password = null,
        int $expiration_duration = 0): bool {}

Associates the key with the other key. The key that is added to the other key is called ‘subkey’. The key that adds the other key to is called ‘parent key’. A parent key can associates many subkeys.

Parameters

Return Values

Returns true on success or false on failure.

Examples

php -r '
$k2hdkc = new K2hdkc("tests/slave.ini");
$k2hdkc->addSubkey("test", "sub");
var_dump($k2hdkc->getSubkeys("test"));
$k2hdkc->close();
'

The above example will output:

array(1) {
  [0]=>
  string(3) "sub"
}

See Also

K2hdkc::getValue K2hdkc Class K2hdkc::casDecrement