PHP code example of root23 / php-json-canonicalization

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

    

root23 / php-json-canonicalization example snippets

code
$canonicalizator = JsonCanonicalizatorFactory::getInstance();
$canonicalizedJsonString = $canonicalizator->canonicalize($input, false);
$canonicalizedJsonString = $canonicalizator->canonicalize($input, true); // hex