PHP code example of xnan / hydra

1. Go to this page and download the library: Download xnan/hydra 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/ */

    

xnan / hydra example snippets


use xnan\Trurl\Hydra;
Hydra\Functions::Load;

(Hydra\hydra())->hydrate();

// create or update your data structures.

(Hydra\hydra())->dehydrate(); // stores all new or changed structures.


$m=(Hydra\hydra())->maps()->retrieveOrCreateHMap(999,"testMap");

$m->set("w","hello");

if ($m->hasKey("w")) echo $m->get("w");  // echoes hello

$m=(Hydra\hydra())->matrixes()->retrieveOrCreateHMatrix(1,"testMatrix",[10,20]);		

$m->set([5,10],33.3);
$v=$m->get([5,10]); // 33.3