Detecting image type from base64 string in PHP

前端 未结 7 1344
闹比i
闹比i 2020-11-27 14:32

Is it possible to find out the type of an image encoded as a base64 String in PHP?

I have no method of accessing the original image file, just the encoded string. F

相关标签:
7条回答
  • 2020-11-27 15:02

    The way shown by @Marc B is the nicest.

    Should FInfo not be available, the only other way I know is to store the data into a file, and run a getimagesize() on it.

    0 讨论(0)
提交回复
热议问题