Answers for "convert base64 to image phpp"

PHP
0

php base64 encoded image to png

$img = $_POST['img'];
$img = str_replace('data:image/png;base64,', '', $img);
$img = str_replace(' ', '+', $img);
$data = base64_decode($img);
$file = "images/" . uniqid() . '.png';
$success = file_put_contents($file, $data);
Posted by: Guest on July-06-2021

Code answers related to "convert base64 to image phpp"

Browse Popular Code Answers by Language