Guest User

Untitled

a guest
Jul 23rd, 2024
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. $imageData = base64_encode(file_get_contents($image));
  2. $src = 'data: '.mime_content_type($image).';base64,'.$imageData;
  3. echo '<img src="' . $src . '">';
  4.  
  5. This displays the image as expected.
  6. Next, here is what the output looks like:
  7.  
  8. <img src="data: ;base64,/9j/4AAQSkZJRgABAQAAAQAB... <snip>
Add Comment
Please, Sign In to add comment