PHP is not just used to create HTML output. It can also be used to create GIF image files, or even make GIF image streams easier. To do this, you need to use the GD function library to compile the PHP source file.
Example 2-2. Use PHP to create a GIF File
Header ("Content-type: image/gif ");
$ String = implode ($ argv ,"");
$ Im = imagecreatefromgif ("images/button1.gif ");
$ Orange = ImageColorAllocate ($ im, 220,210, 60 );
$ Px = (imagesx ($ im)-7.5 * strlen ($ string)/2;
ImageString ($ im, 3, $ px, 9, $ string, $ orange );
ImageGif ($ im );
ImageDestroy ($ im );
?>
This example will be called by a page using a method similar. The script for button. php3 will overwrite the text in the basic graph (here "images/button1.gif") and then output the result graph. This is a simple method to prevent you from re-drawing the button image whenever you want to change the text of the key. In this way, they will be dynamically used.