<?php
header("Content-type: image/png");
$im = @imagecreate(110, 20)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 0, 0, 0);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
imagepng($im);
imagedestroy($im);
?>
How Can i include this image to my php or html file on fly by just
putting an <img src="<? echo $im?>" />
Is it possible without saving the image and giving the path.
The only way I see would be to use data-URI, and to
base64_encode()the content of your image into that ; which would get an<img>tag such as this one (quoting an example from the wikipedia page I linked to) :But note it will not work with all browsers.