1. Remove the part
"data:image/png;base64," from your base64 string.
2. call the base64_decode
string base64_decode ( string $data [, bool $strict = false ] )
3. data on png file.
4. Finally use the following function to convert from png to jpeg
function png2jpg($originalFile, $outputFile, $quality) {
$image = imagecreatefrompng($originalFile);
imagejpeg($image, $outputFile, $quality);
imagedestroy($image);
}
Function above is copied exactly as it is from
some other[
^] site