/** * 根据传入内容生成二维码 */ function eqcode() { $content = htmlspecialchars_decode($this->get->content); $image = new image(); $file = $image->QRCode($content); $this->response->addHeader('Cache-Control', 'cache-directive'); $this->response->addHeader('cache-directive', 'public'); $this->response->addHeader('Content-Type', 'image/png'); if ($this->get->download == 'true') { $this->response->addHeader('Content-Disposition', 'attachment; filename="eqcode.png"'); } echo file_get_contents($file); }