PHP7中文手册2018 带注释 最新chm版
- <?php
- // Requires the GD Library
- header("Content-type: image/png");
- $im = imagecreatetruecolor(512, 512)
- or die("Cannot Initialize new GD image stream");
- $white = imagecolorallocate($im, 255, 255, 255);
- for ($y = 0; $y < 512; $y++) {
- for ($x = 0; $x < 512; $x++) {
- if (rand(0, 1)) {
- imagesetpixel($im, $x, $y, $white);
- }
- }
- }
- imagepng($im);
- imagedestroy($im);
转载请注明:谷谷点程序 » php生成打码的图片