ob_end_clean();
 ob_start();
 //读取图像到缓冲区
 imagepng(imagecreatefrompng('.'.$code_path));
 //得到当前缓冲区的内容并删除缓冲区内容
 $content = ob_get_clean();
 //销毁图片
 if(file_exists('.'.$code_path)){
 unlink('.'.$code_path);
 }
 //返回图片
 return response($content, 200, ['Content-Length' => strlen($content)])->contentType('image/png');

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-12
  • 2021-05-19
  • 2022-12-23
  • 2021-06-15
猜你喜欢
  • 2021-11-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-22
  • 2021-05-03
  • 2022-01-15
相关资源
相似解决方案