K2hdkc::casSet K2hdkc Class K2hdkc::close

K2hdkc::clearSubkey

Removes all subkeys of the key

Description

    public function clearSubkeys(
        string $key): bool {}

Removes all subkeys of the key.

Parameters

Return Values

Returns true on success or false on failure.

Examples

$ php -r '
$handle = new K2hdkc("./tests/slave.ini");
var_dump($handle->setValue("key1", "val1"));
$handle->addSubkey("key1", "key2", "val2");
var_dump($handle->getSubkeys("key1"));
var_dump($handle->clearSubkeys("key1"));
var_dump($handle->getSubkeys("key1"));
'

The above example will output:

bool(true)
array(1) {
  [0]=>
  string(4) "key2"
}
bool(true)
array(0) {
}

See Also

K2hdkc::casSet K2hdkc Class K2hdkc::close