Base64 Encoding Image


$imgPath = 'path-to-your-picture/image.jpg';
$img = base64_encode(file_get_contents($imgPath));
$img = 'data:image/jpg;base64,'. $img;