How to save a base64 decoded image in the filesystem using php?

前端 未结 2 852
忘了有多久
忘了有多久 2021-02-04 15:12

I am getting a base64 encoded JPEG string via a POST request to my web service. I want to decode it and save it in the filesystem. How can I achieve this using PHP 5.3. I am

2条回答
  •  一整个雨季
    2021-02-04 15:42

    If you are sure the image will always be jpg then you can simply use: file_put_contents();

    
    

提交回复
热议问题