Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #image
ADD COMMENT
Topic
Name
7+5 =