كود PHP:
<?php
$img=imagecreatetruecolor(120,40);
$bg=imagecolorallocate($img,250,50,80);
$color=imagecolorallocate($img,154,251,23);
$color2=imagecolorallocate($img,250,20,0);
$char=array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","s","t","u","v","w","x","y","z"
,"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","S","R","T","U","V","X","Y","Z",1,2,3,4,5,6,7,8,9,0);
for($i=0;$i<6;$i++)
{
$txt=$char[rand(0,count($char)-1)];
$txt2.=$char[rand(0,count($char)-1)];
imagestring($img,20,rand(5,80),rand(5,20),$txt,$color);
}
imagestring($img,20,40,15,$txt2,$color2);
header("(anti-spam-content-type:) image/png");
imagepng($img);
?>
طبعا المتغير هو $txt2