K2hash::remove K2hash Class K2hash::rename

K2hash::removeAll

Removes the key and the keys associated with the key

Description

 public bool K2hash::removeAll ( string $key )

Removes the key and the keys associated with the key.

Parameters

Return Values

Returns true on success or false on failure.

Examples

<?php
$k2hash = new K2hash();
$k2hash->openMem();
$k2hash->setValue("test1", "value");
$k2hash->setValue("sub1", "sub-value");
$k2hash->addSubkey("test1", "sub1");

$k2hash->removeAll("test1");
var_dump($k2hash->getValue("test1"));
var_dump($k2hash->getValue("sub1"));
?>

The above example will output:

bool(false)
bool(false)

See Also

K2hash::remove K2hash Class K2hash::rename