Let's say I have a user enter the URL of an image.
After URL validation, etc. I want to get the image and store it in a PHP variable. Not the image path, but the actual image itself.
I am adding this image-holding variable in between other strings, so I cannot change use header()
before echoing the image. Is it possible to use <img>
HTML tags? I really don't want to copy the images to my own server...
How do I:
- Store the image in a variable such that,
- Echo the image from the variable without changing headers.
Edit:
I said above that I am putting this image inside another variable, e.g.:
$str = "blah blah" . $var_holding_img . "more text";
Is it possible to insert something in the string above that will be replaced with the images? Can parse the variable $str
later to replace some random text like "abg30j-as" with the image...