I have a base64 encoded png, how do I write the image to a file in PHP?

前端 未结 3 793
我寻月下人不归
我寻月下人不归 2020-12-01 01:40

What\'s the proper way in PHP to create an image file (PNG), when I have the base64 encoding?

I\'ve been playing around with:


file_put_contents(\'/         


        
3条回答
  •  日久生厌
    2020-12-01 02:13

    I would think you'd want to decode with base64_decode() unless you are only using it like they are here HERE.

    The thing I am sure of is that you will want to sanitize $_REQUEST['id'] before using it.

提交回复
热议问题