Example #1
0
function cpjson($obj)
{
    if (ob_get_contents()) {
        ob_end_clean();
    }
    if (function_exists("json_encode")) {
        echojson(array2json($obj));
    } else {
        include_once dirname(__FILE__) . "/../pacotes/cpaint/cpaint2.inc.php";
        $cp = new cpaint();
        $cp->set_data($obj);
        $cp->return_data();
        exit;
    }
}