K2hash::addAttrPluginLib K2hash Class K2hash::addSubkeys

K2hash::addSubkey

Associates the key with the other key

Description

public bool K2hash::addSubkey ( string $key , string $subkey )

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 ‘parent key’. A parent key can associates many subkeys.

Parameters

Return Values

Returns true on success or false on failure.

Examples

<?php
$k2hash = new K2hash();
$k2hash->openMem();
$k2hash->addSubkey("test", "sub");
var_dump($k2hash->getSubkeys("test"));
$k2hash->close();
?>

The above example will output:

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

See Also

K2hash::addAttrPluginLib K2hash Class K2hash::addSubkeys