K2hdkc::remove
Removes a pair of the key/value
Description
public function remove(
string $key,
string $password = null): bool {}
Removes a pair of the key/value.
Parameters
- key
Specify the key. - password
Specify the password that is associated with the key.
Return Values
Returns true
on success or false
on failure.
Examples
- Example 1 - Removes a key
$ php -r '
$k2hdkc = new K2hdkc("./tests/slave.ini");
var_dump($k2hdkc->setValue("key1", "val1"));
var_dump($k2hdkc->getValue("key1"));
var_dump($k2hdkc->remove("key1"));
var_dump($k2hdkc->getValue("key1"));
'
The above example will output:
bool(true)
string(4) "val1"
bool(true)
string(0) ""
See Also
- K2hdkc::setValue - Sets a pair of the key/value
- K2hdkc::getValue - Gets a value of the key