1, use the GD library function to generate the picture, and write the specified characters on the picture
Imagecreatetruecolor Create a new true color image
Imagecolorallocate Assigning color (palette) to an image
Imagestring drawing characters
Imageline Drawing Lines
Imagesetpixel hit pixel points
2, output picture
Imagejpeg ($IMG);
PHP implementation process, code comments in detail, here do not do too much explanation
verify.php
=("GBK", "Utf-8", "All mortal beings Green Castle and Aoyama places of interest open heart will clouds unroll happiness will always accompany you"(!() || !mb_check_encoding (, "Utf-8"("Not a string or not a Utf-8"= Mb_strlen (, "UTF-8"=(= 0;<;++[] = Mb_substr (,, 1, "UTF-8"= ""(= 0;<4;++((0, 10:.=[(0,-11:.=((0,15["Check"] == Imagecreatetruecolor (100, 30= Imagecolorallocate (, 0, 0, 0= Imagecolorallocate (, 255,255,255Imagettftext (, 13,(2, 9), 20, 20,, "Msyh. TTF ",["Check"] =(= 0;<3;++Imageline (, 0,(0, 20),(70,100),(0, 20),= Imagecolorallocate (,(0, 255),(0, 255),(0, 255(= 0;<200;++,(1, 100),(1, 30),("Content-type:image/jpeg"Imagejpeg (?>< span="">
< span="">< span="">< span="">< span="">< span="">(@< span="">[' Check '< span="">< span=""> < span=""> ( < span=""> < span="">["Check< span="">" "Congratulations!" Verify that the code is entered correctly! "Sorry, the code input error"< span="">< span="">< span="">< span=""> < span=""> ?>
< span="">
http://www.bkjia.com/PHPjc/440246.html www.bkjia.com true http://www.bkjia.com/PHPjc/440246.html techarticle 1, use the GD library function to generate the picture, and write the specified character on the picture Imagecreatetruecolor create a new true color image imagecolorallocate assign a color (palette) to an image images ...