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

后端 未结 5 836
别那么骄傲
别那么骄傲 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:33

    In the first case you should add this before echoing the decoded image data:

    header("Content-type: image/gif");
    

    In the second case, use this instead:

    echo '';
    

提交回复
热议问题