Skip to content

Instantly share code, notes, and snippets.

View acerb's full-sized avatar

Chris. acerb

  • Brussels, BE
View GitHub Profile
@acerb
acerb / jsonutils
Created October 31, 2012 19:19 — forked from troelskn/gist:773216
prettyJsonEncode
<?php
final class JsonUtils
{
/**
* Input an object, returns a json-ized string of said object, pretty-printed
*
* @param (mixed) $obj: The array or object to encode
* @param (int) $indentation: The number of "in front" blanks (difference between levels)
* @param (int) $level: shouldn't be set, define the first level of "blanks"
* @return string JSON formatted output