I am currently doing the following to decode base64 images in PHP:
$img = str_replace(\'data:image/jpeg;base64,\', \'\', $s[\'image\']); $img = str_rep
Function file_get_contents remove header and use base64_decode function, so you get clear content image.
file_get_contents
base64_decode
Try this code:
$img = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA0gA...'; $imageContent = file_get_contents($img);