\[\n\s+\],\n#', "=> [],\n", $dump); // Empties if (gettype($data) == 'object') { // Deal with object states $dump = str_replace('__set_state(array(', '__set_state([', $dump); $dump = preg_replace('#\)\)$#', "])", $dump); } else { $dump = preg_replace('#\)$#', "]", $dump); } if ($return===true) { return $dump; } else { echo $dump; } } switch ($input['mode']) { case 'json': echo var_export_short(@json_decode($data, true)); break; default: echo var_export_short(explode(empty($data_delimiter) ? "\n" : $data_delimiter, $data)); break; }