⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 captcha_non_gd.php

📁 这些都是我以前学习是用到的源码
💻 PHP
📖 第 1 页 / 共 5 页
字号:
			if ($i > $offset_y && $i < $offset_y + $img_height)			{				for ($j = 0; $j < $offset_x; $j++)				{					$image .= chr(mt_rand(140, 255));				}				for ($j = 0; $j < $code_len; $j++)				{					$image .= $this->randomise(substr($hold_chars[$code{$j}][$i - $offset_y - 1], 1), $char_widths[$j]);				}				for ($j = $offset_x + $img_width; $j < $this->width; $j++)				{					$image .= chr(mt_rand(140, 255));				}			}			else			{				for ($j = 0; $j < $this->width; $j++)				{					$image .= chr(mt_rand(140, 255));				}			}		}		unset($hold_chars);		$image = $this->create_png($image, $this->width, $this->height);		// Output image		header('Content-Type: image/png');		header('Cache-control: no-cache, no-store');		echo $image;		exit;	}	/**	* This is designed to randomise the pixels of the image data within	* certain limits so as to keep it readable. It also varies the image	* width a little	*/	function randomise($scanline, $width)	{		$new_line = '';		$end = strlen($scanline) - ceil($width/2);		for ($i = floor($width/2); $i < $end; $i++)		{			$pixel = ord($scanline{$i});			if ($pixel < 190)			{				$new_line .= chr(mt_rand(0, 205));			}			else if ($pixel > 190)			{				$new_line .= chr(mt_rand(145, 255));			}			else			{				$new_line .= $scanline{$i};			}		}		return $new_line;	}	/**	* This creates a chunk of the given type, with the given data

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -