Skip to content

Instantly share code, notes, and snippets.

@fabiobruna
Created August 25, 2014 18:14
Show Gist options
  • Save fabiobruna/f9b8beb1d379007a5799 to your computer and use it in GitHub Desktop.
Save fabiobruna/f9b8beb1d379007a5799 to your computer and use it in GitHub Desktop.
Bruikbaar voor webmail php? From http://php.net/manual/en/function.base64-encode.php
<?php function base64_encode_image ($filename=string,$filetype=string) {     if ($filename) {         $imgbinary = fread(fopen($filename, "r"), filesize($filename));         return 'data:image/' . $filetype . ';base64,' . base64_encode($imgbinary);     } } ?> used as so <style type="text/css"> .logo {     background: url("<?php echo base64_encode_image ('img/logo.png','png'); ?>") no-repeat right 5px; } </style> or <img src="<?php echo base64_encode_image ('img/logo.png','png'); ?>"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment