K2hash::printVersion K2hash Class K2hash::remove

K2hash::putArchive

Saves data as the archive file

Description

 public bool K2hash::putArchive ( string $filepath [, bool $errskip ] )

Saves the k2hash (.k2h) file as an archive file.

Parameters

Return Values

Returns true on success or false on failure.

Examples

<?php
$k2hash = new K2hash();
$k2hash->openMem();
$k2hash->setValue("key1", "value1");
var_dump($k2hash->putArchive("/tmp/test_k2h_archive", true));
$k2hash->close();

$k2hash2 = new K2hash();
$k2hash2->openMem();
$k2hash2->loadArchive("/tmp/test_k2h_archive", true);
var_dump($k2hash2->getValue("key1"));
$k2hash2->close();
?>

The above example will output:

bool(true)
string(6) "value1"

See Also

K2hash::printVersion K2hash Class K2hash::remove