How to save a PNG image server-side, from a base64 data string

后端 未结 15 2358
情话喂你
情话喂你 2020-11-22 03:18

I\'m using Nihilogic\'s \"Canvas2Image\" JavaScript tool to convert canvas drawings to PNG images. What I need now is to turn those base64 strings that this tool generates,

15条回答
  •  遥遥无期
    2020-11-22 03:34

    Try this:

    file_put_contents('img.png', base64_decode($base64string));
    

    file_put_contents docs

提交回复
热议问题