function encode_image($filename)
{
$contents = file_get_contents($filename);
$base64 = base64_encode($contents);
$imagetype = exif_imagetype($filename);
$mime = image_type_to_mime_type($imagetype);
return "data:$mime;base64,$base64";
}
Usage:
echo "<img src='".encodeimg("images/userimage.jpg")."'/>";
Guna
Normal images links will be cached how about this?
0
0