1. Go to this page and download the library: Download commandstring/jsondb 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/ */
commandstring / jsondb example snippets
use CommandString\JsonDb\Structure\Database;
use CommandString\JsonDb\Structure\Table;
class YourDatabase extends Database {
protected static array $tableClasses = [];
}
$db = new YourDatabase; // you can also pass JSON encoder flags into the constructor
$row = $db->yourtable->newRow();
$row->setColumn($db->yourtable::COLUMN_NAME, "<value>") // you can pass a string for the column name but I recommend having constants has mentioned earlier
$row = $row->store(); // returns that same row but this is associated to specific point in the JSON file