PHP code example of prowebcraft / php-json-db

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

    

prowebcraft / php-json-db example snippets


$db = new \Prowebcraft\JsonDb([
  'name' => 'users.json',
  'dir' => getcwd()
]);
 
$db->set('user', [
    'firstname' => 'John',
    'lastname' => 'Doe'
]);

$db->set('user.age', 18);

$db->save();

$db->get('user.age');