PHP code example of niobe / ezytoon
1. Go to this page and download the library: Download niobe/ezytoon 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/ */
niobe / ezytoon example snippets
oon\EzyToon;
$toon = new EzyToon();
// Read original JSON content
$jsonContent = file_get_contents('test.json');
$data = json_decode($jsonContent, true);
echo $toon->encode($data);
oon\EzyToon;
$toon = new EzyToon(
indentsize: 2,
delimiter: ','
);
// Read original JSON content
$jsonContent = file_get_contents('test.json');
$data = json_decode($jsonContent, true);
// Encode to TOON
$encoded = $toon->encode($data);
echo $encoded;