FileInfo can do that for you:
$encoded_string = "....";
$imgdata = base64_decode($encoded_string);
$f = finfo_open();
$mime_type = finfo_buffer($f, $imgdata, FILEINFO_MIME_TYPE);
More Related Contents:
- How to save a PNG image server-side, from a base64 data URI
- Passing base64 encoded strings in URL
- Convert Base64 string to an image file? [duplicate]
- How to convert an image to Base64 encoding
- Slowness found when base 64 image select and encode from database
- Base64 Encoding Image
- PHP – get base64 img string decode and save as jpg (resulting empty image )
- Sending images from Canvas elements using Ajax and PHP $_FILES
- Android post Base64 String to PHP
- PHP get pdf file from base64 encoded data string
- Sending/Displaying a base64 encoded Image
- How verify if input is numeric
- PHP Subtracting two number gives wrong values [closed]
- How to apply bindValue method in LIMIT clause?
- How to Truncate a string in PHP to the word closest to a certain number of characters?
- Best way to parse bbcode
- Use one bind_param() with variable number of input vars
- PHP UPDATE prepared statement
- PHP – split String in Key/Value pairs
- MCrypt rijndael-128 to OpenSSL aes-128-ecb conversion
- CodeIgniter PHP Model Access “Unable to locate the model you have specified”
- Remove duplicate items from an array [duplicate]
- ERROR: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it
- How to convert ISO8601 to Date format in php
- PHP save image file [duplicate]
- Display an array in a readable/hierarchical format [duplicate]
- Recreate original PHP array from print_r output [duplicate]
- UNION syntax in Cakephp
- How to make public folder as root in Laravel?
- How to do single sign-on with PHP? [closed]