Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $imageData = base64_encode(file_get_contents($image));
- $src = 'data: '.mime_content_type($image).';base64,'.$imageData;
- echo '<img src="' . $src . '">';
- This displays the image as expected.
- Next, here is what the output looks like:
- <img src="data: ;base64,/9j/4AAQSkZJRgABAQAAAQAB... <snip>
Add Comment
Please, Sign In to add comment