How to decode a base64 string (gif) into image in PHP / HTML

后端 未结 5 837
别那么骄傲
别那么骄傲 2020-12-06 04:51

I have a base64 encoded string that I would like to convert into an image in PHP / HTML.

Here is what I have:

$data = \"R0lGODdhAAGAAKIAAP38+/3h3cj         


        
5条回答
  •  自闭症患者
    2020-12-06 05:34

    You have to use the header() function before echoing your data to specify the content type (gif image). Otherwise browsers will interpret it as html.

提交回复
热议问题