$image = file_get_contents($file);
echo "<img src='data:image/png;base64,".base64_encode($contents)."' />";
Ref : http://php.net/manual/en/book.image.php
echo "<img src='data:image/png;base64,".base64_encode($contents)."' />";
Output:
<img src='data:image/jpeg;base64,/9j/4AA...........//9k=' />
Ref : http://php.net/manual/en/book.image.php
No comments:
Post a Comment