PHP code example of wallacesilva / phpjsonlite

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

    

wallacesilva / phpjsonlite example snippets


$jsonlite = new JSONlite\JSONlite();
// e.g.: $jsonlite->methodName();

$object = array(
    'id'            => 1, 
    'name'          => 'John Doe', 
    'active'        => true, 
    'permissions'   => array(
        'read'      => true,
        'write'     => false,
        'execute'   => true
    )
);
$document_id = $jsonlite->set($object);
// return also like: '666B81D6-3F8A-4D57-BA3F-11FA8FC47246'

$object = $jsonlite->get($document_id);
// return also like:
/**
{
    "active": true,
    "name": "John Doe",
    "permissions": {
        "read": true,
        "write": false
    }
}
*/

$jsonlite->drop()

$jsonlite->version()
// return also like: 0.1.0