Created
August 25, 2014 18:14
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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