PHP code example of swokit / memory

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

    

swokit / memory example snippets


$userTable = new MemoryTable('user', 1024);
$userTable->setColumns([
     'id' => [Table::TYPE_INT, 10],
     'username' => [Table::TYPE_STRING, 32],
     'password' => [Table::TYPE_STRING, 64],
]);

// create it
$userTable->create();

$userTable->save('key', [
    'username' => 'tom',
    'password' => 'string',
]);

$row = $userTable->get('key');
$password = $userTable->get('key', 'password');