1. Go to this page and download the library: Download andkom/php-berkeley-db library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
andkom / php-berkeley-db example snippets
use AndKom\BerkeleyDb\Adapter\AdapterFactory;
$adapter = AdapterFactory::create(); // use first available adapter
$adapter = AdapterFactory::create("phpdb4"); // use phpdb4 adapter
$adapter = AdapterFactory::create("dba"); // use dba adapter
$adapter->open("filename", "r");
$adapter->open("filename", "r", "main");
$adapter->open("filename", "w");
$adapter->close();
$adapter->sync();
$value = $adapter->get("key");
$adapter->put("key", "value");
$adapter->delete("key");
$adapter->firstKey();
$adapter->nextKey();
foreach ($adapter->read() as $key => $value) {
...
}