Example #1
0
 /**
  * 输出内容,可以是数组,可以是文本
  *
  * @param array | string $mix 输出内容
  * @param bool $exit 是否结束程序
  */
 public static function output($mix, $exit = true)
 {
     global $_F;
     $response = new self();
     if (is_array($mix)) {
         $response->setContentType('json');
         if ($_F['debug']) {
             $mix['debug_info'] = $_F['debug_info'];
         }
         $response->write(json_encode($mix));
     } elseif (is_string($mix)) {
         $response->write($mix);
     }
     $exit && exit;
 }