PHP code example of gromnan / json-crunch
1. Go to this page and download the library: Download gromnan/json-crunch 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/ */
gromnan / json-crunch example snippets
use function GromNaN\JsonCrunch\crunch;
$data = json_decode('{"a":["a","b","a"],"b":["a","b","a"]}');
$crunched = crunch($data);
echo json_encode($data, JSON_PRETTY_PRINT);