K2hash::getSubkeys
Gets an array of keys associated with the key
Description
public arrayfalseK2hash::getSubkeys ( string $key [, bool $attrcheck ] )
Gets an array of the keys associated with the key.
Parameters
- key
Specifies the key. - attrcheck
Specifies true if getting subkeys after checking attributes, otherwise false.
Return Values
Returns an array of keys associated with the key.
Examples
- Example 1 - Gets an array of keys associated with a key
<?php
$k2hash = new K2hash();
$k2hash->openMem();
$k2hash->addSubkeys("test", array("subkey1", "subkey2", "subkey3"));
var_dump($k2hash->getSubkeys("test"));
$k2hash->close();
?>
The above example will output:
array(3) {
[0]=>
string(7) "subkey1"
[1]=>
string(7) "subkey2"
[2]=>
string(7) "subkey3"
}
See Also
- K2hash::addSubkey - Associates the key with the other key
- K2hash::addSubkeys - Adds the subkeys to the key