-
-
Save SecureCloud-biz/da43a75092421c9a495e to your computer and use it in GitHub Desktop.
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 | |
$files = array_slice($argv, 1); | |
foreach ($files as $file) { | |
$picture = file_get_contents($file); | |
$size = getimagesize($file); | |
// base64 encode the binary data, then break it into chunks according to RFC 2045 semantics | |
$base64 = chunk_split(base64_encode($picture)); | |
echo '<img src="data:' . $size['mime'] . ';base64,' . "\n" . $base64 . '" ' . $size[3] . ' />', "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment