How to save an image created from imagecreatefromstring() function?

后端 未结 2 765
清歌不尽
清歌不尽 2021-02-18 23:11

Here is my code:

$data = \'iVBORw0KGgoAAAANSUhEUgAAABwAAAASCAMAAAB/2U7WAAAABl\'
       . \'BMVEUAAAD///+l2Z/dAAAASUlEQVR4XqWQUQoAIAxC2/0vXZDr\'
       . \'EX4IJT         


        
2条回答
  •  庸人自扰
    2021-02-18 23:25

    This is the correct syntax for imagepng:

    imagepng($im, "/path/where/you/want/save/the/png.png");
    

    According to the PHP manual:

    bool imagepng ( resource $image [, string $filename [, int $quality [, int $filters ]]] )

    filename - The path to save the file to.

    If not set or NULL, the raw image stream will be outputted directly.

提交回复
热议问题