K2hash::removeAll K2hash Class K2hash::setCommonAttribute

K2hash::rename

Renames the key

Description

 public bool K2hash::rename ( string $key , string $newkey )

Renames the key

Parameters

Return Values

Returns true on success or false on failure.

Examples

<?php
$k2hash = new K2hash();
$k2hash->openMem();
$k2hash->setValue("test1", "value");
var_dump($k2hash->rename("test1", "test2"));
var_dump($k2hash->getValue("test2"));
?>

The above example will output:

bool(true)
string(5) "value"

See Also

K2hash::removeAll K2hash Class K2hash::setCommonAttribute