/** * 返回JSON格式数据 * * @param mixed $data */ public static function sendJSON($data = null) { @header('content-type: application/json'); if (is_array($data) && APP::$is_debug) { $data['debug'] = DEBUG::get(); } echo json_encode($data); APP::end(); }