K2hdkc::keyQueuePut K2hdkc Class K2hdkc::setSubkeys

K2hdkc::rename

Renames a pair of the key/value

Description

    public function rename(
        string $key,
        string $new_key,
        string $parent_key = null,
        bool $is_check_attr = true,
        string $password = null,
        int $expiration_duration = 0): bool {}

Renames a pair of the key/value.

Parameters

Return Values

Returns true on success or false on failure.

Examples

$ php -r '
$k2hdkc = new K2hdkc("./tests/slave.ini");
var_dump($k2hdkc->setValue("key1", "val1")); 
var_dump($k2hdkc->getValue("key1"));   
var_dump($k2hdkc->rename("key1", "key2"));
var_dump($k2hdkc->getValue("key2"));
'

The above example will output:

bool(true)
string(4) "val1"
bool(true)
string(4) "val1"

See Also

K2hdkc::keyQueuePut K2hdkc Class K2hdkc::setSubkeys