PHP Chinese Verification Code implementation sample sharing _php Tutorial

Source: Internet
Author: User
Copy CodeThe code is as follows:
$text = ' The one is not able to be good all the time, but also to do when you want to see the text without opening the hand of ten with the main line and as before the craniofacial of the same three have been old from the two long know the people like the present points will be outside but the body and Coe into the law of the two, the United States point of the Moon Ming, the sound of their own words to the Ministry of the State of the truth of the woman asked the power machine to wait a few very much the most New Shi fight will be four the first phase of the gate Zedong Haikou to teach West again flat really listen to the world gas letter North less off and add in by the army produced into the first mountain five too water million city eye body elsewhere always field master book than live nine Laugh Sex Tong Mu newspaper immediately life Zhang Live hard god number of pieces of the original car white in the road period is called death often mention the sense of gold, and more anti-Bensley to do the system or the light Wangguo pro-sector and the present Beijing to the system of the solution to the clear table elephant record side of the wind War dry connect it Xu Bate feel straight to the maullin of the problem to build the south degree Color word please make love let ';
$im = Imagecreatetruecolor (100,45);
$font = './msyhbd.ttf ';
$len = Mb_strlen ($text, ' UTF-8 ');
$grey = Imagecolorallocate ($im, 200,200,200);
Imagefill ($im, 0,0, $grey);
for ($i = 0, $x = 0; $i < 4; $i + +) {
$color = Imagecolorallocate ($im, Mt_rand (0,190), Mt_rand (0,190), Mt_rand (0,190));
$x + = $i *10 + mt_rand (1,5);
$tmp = Mb_substr ($text, Mt_rand (0, $len), 1, ' UTF-8 ');
Imagettftext ($im, Mt_rand (10,16), Mt_rand ( -15,15), $x, Mt_rand (21,25), $color, $font, $tmp);
}
Header (' content-type:image/png ');
Imagepng ($im);
Imagedestroy ($im);
?>

http://www.bkjia.com/PHPjc/694665.html www.bkjia.com true http://www.bkjia.com/PHPjc/694665.html techarticle Copy the code as follows: Php $text = ' of a can not be good all the time, but also to do when you want to see the text without open hand ten with the main line and as the previous see through the craniofacial public with three old ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.