Convert image to string (for Symfony2 Response)

前端 未结 1 864
抹茶落季
抹茶落季 2021-01-02 15:15

I\'m building a script for image resizing in Symfony2.

As I\'d like to be able to use standard Symfony2 response system...

$headers = array(\'Content         


        
相关标签:
1条回答
  • 2021-01-02 15:34

    Output buffering is probably the best solution.

    BTW you can call one less function:

    ob_start();
    imagepng($img);
    $str = ob_get_clean();
    
    0 讨论(0)
提交回复
热议问题