Hello Reader's If you have some string in base64 and you need them to convert into image file, Then by using PHP you can do this as follows:-
function base64Tojpeg($base64_string, $output_file) {
$ifp = fopen($output_file, "wb");
$data = explode(',', $base64String);
fwrite($ifp, base64_decode($data[1]));
fclose($ifp);
return $output_file;
}
Here now everytime string in base64 will get, function will return it into a jpeg file.
0 Comment(s)