Process:
1). Create an image resource, which will be based on this image resource in future operations.
$im =imagecreate (200,200)
2). Within the image resource, define a color (the 1th call, which is automatically populated as a background color).
Imagecolorallocate ($im, 0,102,255);
$white =imagecolorallocate ($im, 255,255,255);
3). Within an image resource, draw a graphic, or enter text.
(1) Coordinate system: the upper-left corner of the image resource is 0, 0 points
(2) All of the following coordinates, refers to: this coordinate system, the upper-left corner of a position coordinates
(2) Line: Imageline ($im, 0, 0, $, a, $white);
(3) Line: Imageline ($im, 0, 0, $, $white);
(3) Characters: Imagestring ($im, 5, N, Mr.Lee, $white);
4). Output the final graphic. Can be output directly, or generate files
If direct output, need to use header (), tell the browser, the current output of the picture type
Header (' content-type:image/png ');
Imagepng ($im);
5). Clear All Resources
Imagedestroy ($im);
The above describes the PHP create image verification code, including the aspects of the content, I hope the PHP tutorial interested in a friend helpful.