frankly speaking, I'm not sure if this is duplication of another question since the context should be different.
I currently working with some API that returns status & contents(binary data image) which I will base64 encode at first. The question is how to initially get the image type on it's binary data form, & after that convert it to actual image with its type extension. In this scenario, I'm using PHP since it involves with backend task. Thanks.
updates: for this case, I get the image in binary form from external site api. I use file_get_contents but it returns empty or null. When i use base64_encode then it will shows up the image as an encoded data. the issue is I need to convert it as normal image. I try getimagesize as encoded & decoded & try to print the output & it returns empty. is there any steps I am still missing?