Answers for "b64 encode a image php"

PHP
7

php image to base64

$path = 'myfolder/myimage.png';
$type = pathinfo($path, PATHINFO_EXTENSION);
$data = file_get_contents($path);
$base64 = 'data:image/' . $type . ';base64,' . base64_encode($data);
Posted by: Guest on October-02-2020

Browse Popular Code Answers by Language