public static function encode($obj, $pretty = false, $html = false)
    {
        $s = json_encode($obj);

        if ($pretty) {
            return self::format($s, $html);
        }

        return $s;
    }
public static function encode($obj, $pretty = false, $html = false)
    {
        $s = json_encode($obj);

        if ($pretty) {
            return self::format($s, $html);
        }

        return $s;
    }
public static function encode ( $ obj , $ pretty = false , $ html = false ) { $ s = json_encode ( $ obj ) ; if ( $ pretty ) { return self :: format ( $ s , $ html ) ; } return $ s ; }
Encodes the object in json

@param mixed   $obj    The object to encode
@param boolean $pretty When TRUE, the output is "pretty" with proper indentation
@param boolean $html   If true, return the JSON in a format suitable for display in a web browser
Default: false

@return string
Encodes the object in json