Exemplo n.º 1
0
 /**
  * 重定向一个响应信息
  *
  * @param string $location 重定向的地址
  * @param int $status 状态码,默认为302
  * @return void
  */
 public static function send_redirect($location, $status = 302)
 {
     if (!is_int($status) || $status < 300 || $status > 399) {
         return;
     }
     self::add_header('Location', $location, true);
     self::set_status($status);
     self::$_is_redirect = true;
     self::send_headers();
     exit;
 }