php - Getting extension of an image from base64 encoded string -Cakephp -


iam doing apis of ios application in cakephp.iam getting base64 encoded string request parameter.how can find extension of image(png,jpeg) string.

first need decode string can extract extension string. code example below should work you.

$filename = base64_decode($encoded);  $extension = substr($filename, strpos($filename, ".") + 1);  echo $extension; 

lee


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -