<?phpSo far all of the images we have created have been PNG format. Above, we are creating a GIF using the ImageGif () function. We also change are headers accordingly. You can also use ImageJpeg () to create a JPG, as long as the headers change to reflect it appropriately.
header ("Content-type: image/gif");
$handle = ImageCreate (130, 50) or die ("Cannot Create image");
$bg_color = ImageColorAllocate ($handle, 255, 0, 0);
$txt_color = ImageColorAllocate ($handle, 0, 0, 0);
ImageString ($handle, 5, 5, 18, "PHP.About.com", $txt_color);
ImageGif ($handle);
?>
You can call the php file just like you would a normal graphic. For example:
<img src="http://www.yoursite.com/YourScript.php">

