Home >Backend Development >PHP Tutorial >Simple Chinese verification code

Simple Chinese verification code

WBOY
WBOYOriginal
2016-07-25 08:48:561146browse
Simple Chinese verification code
  1. $text = 'One thing is that I can't do it without him. When I came to this country, I said that when I debuted with you as my son, I had to live my life for myself. She has been trying to learn how to deal with family problems, but she has been worried about it for many days and has not been able to get better. She has never done anything since then. She only wants to see Wen Wu open her hands and use the main method, and it is as seen before. The same three are old and active, and the two elders know the people. They are now separated, but they are more involved with Gao Yijin. They return to the truth of the law and the beauty of the two principles. The moon makes it clear that all the people who have done their own work have asked the Ministry of Intelligence to rectify the name of the woman. I have been waiting for a long time. The latest news is that the fourth gate was leaked due to heavy traffic. Wu Tai Shui Wan City Eye Body Elsewhere General Talent Teacher Shu Bi Resident Nine Smiles Tongmu Hua Bao Immediately Order Zhang Live Difficult God Several Safety Meters Original Car Bai Ying Road Period Called Death Chang Meng Sen Jin He More Anti-combined As a system planner or secretary, Wang Guang was responsible for his relatives and the current Beijing affairs system. He went to the Qing Dynasty to remember the common wind and the war. ';
  2. $im = imagecreatetruecolor(100,45);
  3. $font = './msyhbd.ttf';
  4. $len = mb_strlen($text,'UTF-8');
  5. $grey = imagecolorallocate($im, 200,200,200);
  6. imagefill($im,0,0,$grey);
  7. for($i = 0,$x = 0 ;$i < 4 ; $i++ ){
  8. $color = imagecolorallocate($im,mt_rand (0,190),mt_rand(0,190),mt_rand(0,190));
  9. $x += $i*10 + mt_rand(1,5);
  10. $tmp = mb_substr($text,mt_rand(0,$len),1 ,'UTF-8');
  11. imagettftext($im,mt_rand(10,16),mt_rand(-15,15),$x,mt_rand(21,25),$color,$font,$tmp);
  12. }
  13. header('content-type:image/png');
  14. imagepng($im);
  15. imagedestroy($im);
  16. ?>
Copy code


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn