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
- key
Specifies the key.
Return Values
Returns true on success or false on failure.
Examples
- Example 1 - Remove the key
<?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 - Removes the key
- K2hash::setValue - Sets the value associated with the key