There is a corresponding image type in the GD library imagejpeg(),imagegif(),imagepang() 5, imageline line drawing function iamgeline(resource image,int x1,int y1,int x2,int y2,int color); image ---picture x1 ---starting coordinates y1 x2 ---end point coordinates y2 6, imagesetpixel drawing point function imagesetpixel(resource image,int x,int y,int color) 7, imagettftext writing function with font imagettftext(resource image,float size,float angle,int x,int y,int color,string fontfile,string text) 8. How to insert Chinese PHP verification code iconv("gb2312","utf-8","string"); //First convert the text into utf-8 format 9, random function 1, rand([int min,int max]) //rand(1,4) generates numbers from 1 to 4 2, dechex (decimal number) //Convert to hexadecimal The above introduces some common methods of gd library function in PHP, as well as the method of inserting Chinese into PHP verification code. When it comes to the problem of displaying Chinese in PHP verification code, you can refer to the PHP Chinese character verification code (example) introduced before This article. In addition, friends who are interested can also study the implementation methods of PHP random verification code and PHP image verification code, which will be very helpful for understanding today's example. In php, steps to generate verification code: Generate random numbers - create pictures - write random numbers into pictures - save in session. 1. Enter the verification code gdchek.php
2, login page login.php
|