function gs_json_encode($content) { if (!extension_loaded('json')) { if (!class_exists('GS_Services_JSON')) { require_once 'GSJSON.php'; } $json = new GS_Services_JSON(); return $json->encode($content); } else { return json_encode($content); } }