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

visual studio - vb.net filter binding source by time -

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -