PHP code example of walnut / lib_jsonserializer

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

    

walnut / lib_jsonserializer example snippets


$serializer = new PhpJsonSerializer;

echo $serializer->encode(['a' => 1]); //outputs {"a": 1}

echo $serializer->decode('{"a": 1}', true)['a']; //outputs 1
echo $serializer->decode('{"a": 1}', false)->a; //outputs 1