Created
September 8, 2015 16:46
-
-
Save timwright12/3adfab03dc7d414c832b to your computer and use it in GitHub Desktop.
This file contains 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 | |
$SITEPATH = $_SERVER['DOCUMENT_ROOT'] . '/path/to/dir/'; | |
function get_uri( $image, $mime = '' ) { | |
return 'data: ' . $mime . ';base64,'.base64_encode(file_get_contents( $image )); | |
} | |
?> | |
<img src="<?php echo get_uri($SITEPATH . 'images/worms.jpg', 'image/jpg'); ?>"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment