- json_decode: documentation ( source)
- version_compare: documentation ( source)
- json_encode: documentation ( source)
<?php
if(version_compare(PHP_VERSION, '-5.3.0') >= 0) {
$a = json_decode('{"pageSize":50,"sortBy":32,"sortDesc":true,"filterPatterns":[],"colorPatterns":[]}', true);
echo json_encode($a, 0 + (defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 0));
}