K2hdkc::remove K2hdkc Class K2hdkc::rename

K2hdkc::removeSubkeys

Removes subkeys

Description

    public function removeSubkeys(
        string $key,
        array $subkeys,
        bool $nested = false): bool {}

Removes subkeys.

Parameters

Return Values

Returns true on success or false on failure.

Examples

$ php -r '
$k2hdkc = new K2hdkc("./tests/slave.ini");
$k2hdkc->addSubkey("test", "sub1", "subv1");
$k2hdkc->addSubkey("test", "sub2", "subv2");
var_dump($k2hdkc->getSubkeys("test")); 
var_dump($k2hdkc->removeSubkeys("test", array("sub1")));
var_dump($k2hdkc->getSubkeys("test")); 
$k2hdkc->close(); 
'

The above example will output:

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

See Also

K2hdkc::remove K2hdkc Class K2hdkc::rename