Generate graphical verification code in php_PHP tutorial

WBOY
Release: 2016-07-13 10:45:11
Original
812 people have browsed it

We have talked a lot about generating graphical verification codes with PHP. This is a very simple tutorial suitable for beginners of PHP, a sample code for generating verification codes with PHP.

We have talked a lot about generating graphical verification codes in PHP tutorials. This is a very simple tutorial suitable for those who are getting started with PHP, with example codes for generating verification codes using PHP.

$height = 300;
$width = 300;
//Create background image
$im = ImageCreateTrueColor($width, $height);
//Assign color
$white = ImageColorAllocate ($im, 255, 255, 255);
$blue = ImageColorAllocate ($im, 0, 0, 64);
//Draw color to image
ImageFill($im, 0, 0, $blue);
//Draw string: Hello,PHP
ImageString($im, 10, 100, 120, 'Hello,PHP', $white);
//Output image, define header
Header ('Content-type: image/png');
//Send image to browser
ImagePng($im);
//Clear resources
ImageDestroy($im);
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/633051.htmlTechArticleWe have talked a lot about generating graphical verification codes in PHP. This is a very simple tutorial suitable for PHP beginners. , a sample code that uses PHP to generate verification codes. About php tutorial generation...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!