: This article mainly introduces how to create the simplest verification code of php. if you are interested in the PHP Tutorial, refer to it. I am a computer student about to go out for an internship. I have learned some simple things about php. Today, I sent my verification code for your advice. The code is as follows:
$ Red1, '1' => $ green1, '2' => $ blue1); // fill the canvas background color imagefill ($ img, 0, 0, $ bgcolor ); // add the verification code content for ($ I = 0; $ I <4; $ I ++) {$ content. = ''; $ c} imagestring ($ img, 40, 20, 10, $ content, $ col [rand (0, 2)]); // add interference factors // add interference points for ($ I = 0; $ I <50; $ I ++) {imagesetpixel ($ img, rand ), rand (), $ col [rand ()]);} // add interference line for ($ j = 0; $ j <4; $ j ++ ){
// Imageline function format: imageline (image, x1, y1, x2, y2, color); imageline ($ img, rand (), rand ), rand (), rand (), $ col [rand ()]);} // output image imagepng ($ img ); // release the image resource imagedestroy ($ img);?>
Zookeeper
The above describes how to prepare the most simple php verification code, including the content, and hope to be helpful to friends who are interested in PHP tutorials.