Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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);
Source by gist.github.com #
 
PREVIOUS NEXT
Tagged: #php #encoded #image #png
ADD COMMENT
Topic
Name
4+1 =