Painting a button with a PHP
You always spend a lot of time to do some press, to design a good button background all! Text can be replaced at will! Header ("content-type: image / gif"); if (! Isset ($ s)) $ s = 11; //times.tif can be any font you like $ size = imagetfbbox ($ s, 0 , "/fonts/times.ttf",! // Set the length of $ dx = abs ($ size [2] - $ size [0]); $ dy = abs ($ size [5] - $ Size [3]); $ XPAD = 9; $ ypad = 9; $ = imagecreate ($ DX $ XPAD, $ DY $ YPAD); // Set R, G, B $ Blue = ImageColorallocate ($ IM, 0x2C , 0x6D, 0xAF; $ black = imagecolorallocate ($ IM, 0, 0); $ white = imagecolorallocate ($ IM, 255, 255, 255); // Draw ImageRectangle ($ IM, 0, 0, $ DX $ XPAD-1 $ DY $ YPAD-1, $ Black); ImageRectangle ($ IM, 0, 0, $ DX $ XPAD, $ DY $ YPAD, $ White); ImageTfText ($ IM, $ S, 0, (INT) ($ XPAD / 2) 1, $ DY (int) ($ black, "/fonts/times.ttf", $ text); ImageTfText ($ IM, $ S, 0, (INT) ($ XPAD / 2), $ DY ($ YPAD / 2) -1, $ White, "/FONTS/TIMES.TTF", $ text); ImageGIF ($ IM); "Importestroy;?> Important You can't add any HTML tags in this code, especially in the And?> To join! Write the following code when calling: S is the picture size text is the picture of the picture, try it!