PHP code example of jlaso / simple-memory-db
1. Go to this page and download the library: Download jlaso/simple-memory-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/ */
jlaso / simple-memory-db example snippets
BigExample/generate.php
BigExample/demo.php
class TaxTable extends AbstractTable
{
protected $subtypes = [
0 => 'mandatory',
1 => 'optional',
2 => 'regulated',
3 => 'unknown',
];
protected function processRecord(&$record)
{
$module = count($this->subtypes);
$record['subtype'] = $this->subtypes[intval($record['value'] * 100) % $module];
return true; // or return false if you want to filter this record
}
}
remove($id)
$id
saveToJsonFile($fileName)