PHP code example of fefas / jsoncoder

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

    

fefas / jsoncoder example snippets




use Fefas\Jsoncoder\Json;

$json1 = Json::createFromString('{"field":"value"}'); // from a json string
$json2 = Json::create(['field' => 'anotherValue']); // from PHP values

echo $json1; // {"field":"value"}
echo $json2; // {"field":"anotherValue"}

$json1->decode(); // ['field' => 'value']
$json2->decode(); // ['field' => 'anotherValue']

$json1->isEqualTo($json2); // false