PHP code example of amirhwsin / jstorage

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

    

amirhwsin / jstorage example snippets


$ composer 

use jStorage;

$jStorage = new jStorage\App('storage_folder/db.json', __DIR__ .  '/.gitignore');

 $jStorage = new jStorage\App('storage_folder/db.json');

 $jStorage->add('username',[
     'password' => 'JG^RWY',
     'first_last_name' => 'Amirhossein Meydani',
     'email' => '[email protected]'
 ]);

$jStorage->add('username','amirhossein');

$jStorage->add('phone_number',19248124);

$jStorage->add('is_prefect_day', true);

$jStorage->commt();

$is_prefect_day = $jStorage->get('is_prefect_day');

$jStorage->update('key','new value');

$jStorage->commt();

$jStorage->remove('key');

$jStorage->commt();