I am trying to use the IMAP functions to fetch the email attachments. Also, I am trying to fetch the inline images and show them out to the screen by using <img>
tag. In order not to occupy so much server space, I decided not to save those fetched inline images as files on the server and show them on the screen. My decision is that after fetching the content of one of the inline image, print it out by using echo
function, then use <img>
tag to show the printed content out one by one. The code may look like the following part:
show-inline-image.php
<?php
...(omit)...
echo $image_content; //The variable $image_content is the content of fetched inline image
?>
show-image.php
<?php
...(omit)...
echo "<img src='show-inline-image.php'>"; //Show the image
...(omit)...
?>
Though this way could print the inline images out successfully. But I am not sure whether it is alright to show the inline images in this way. Is there any other better ways to impove it?
P.S. The output result of show-inline-image.php may look like the image below: