Answers for "symfony decrypte images base64 enregistre"

PHP
0

symfony decrypte images base64 enregistre

<?php

    createImage($_POST['monImageBase64']);

    public function createImage($img)
    {
        $path = "images/";

        $image_parts = explode(";base64,", $img);
        $image_type_aux = explode("image/", $image_parts[0]);
        $image_type = $image_type_aux[1];
        $image_en_base64 = base64_decode($image_parts[1]);
        $file = $path . uniqid() . '.png';

        file_put_contents($file, $image_en_base64);
    }

?>
Posted by: Guest on March-26-2020

Browse Popular Code Answers by Language