PHP code example of 8ctopus / relaxed-json

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

    

8ctopus / relaxed-json example snippets


use Oct8pus\RelaxedJson;

$json = <<<JSON
{
    // maximum requests per hour
    "throttleThreshold": 300,
}

JSON;

var_dump(RelaxedJson::decode($json, true));

$json = <<<JSON
{
    "throttleThreshold" => 300,
}

JSON;

// throws RelaxedJsonException Syntax error
RelaxedJson::decode($json, true);