PHP code example of im-denisenko / php-json-encode

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

    

im-denisenko / php-json-encode example snippets


$data = array('foo' => 'bar');
echo Future\Json::encode($data, JSON_PRETTY_PRINT);
echo Future\Json::encode($data, JSON_NUMERIC_CHECK);
echo Future\Json::encode($data, JSON_UNESCAPED_SLASHES);
echo Future\Json::encode($data, JSON_UNESCAPED_UNICODE);
echo Future\Json::encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
echo Future\Json::encode($data, null, 4);

future_json_encode($data, JSON_UNESCAPED_UNICODE, 10);