Kod;
- Kod:
[color=#000000]
[color=#0000BB]<?
$imagekod [/color][color=#007700]= [/color][color=#DD0000]''[/color][color=#007700];
for ([/color][color=#0000BB]$i [/color][color=#007700]= [/color][color=#0000BB]0[/color][color=#007700]; [/color][color=#0000BB]$i [/color][color=#007700]< [/color][color=#0000BB]8[/color][color=#007700]; [/color][color=#0000BB]$i[/color][color=#007700]++) {
[/color][color=#0000BB]$imagekod [/color][color=#007700].= [/color][color=#0000BB]chr[/color][color=#007700]([/color][color=#0000BB]mt_rand[/color][color=#007700]([/color][color=#0000BB]100[/color][color=#007700],[/color][color=#0000BB]120[/color][color=#007700]));
[/color][color=#0000BB]$imagekod[/color][color=#007700]=[/color][color=#0000BB]strtoupper[/color][color=#007700]([/color][color=#0000BB]$imagekod[/color][color=#007700]);
}
[/color][color=#FF8000]// set up image
[/color][color=#0000BB]$height [/color][color=#007700]= [/color][color=#0000BB]30[/color][color=#007700];
[/color][color=#0000BB]$width [/color][color=#007700]= [/color][color=#0000BB]100[/color][color=#007700];
[/color][color=#0000BB]$im [/color][color=#007700]= [/color][color=#0000BB]ImageCreate[/color][color=#007700]([/color][color=#0000BB]$width[/color][color=#007700], [/color][color=#0000BB]$height[/color][color=#007700]);
[/color][color=#0000BB]$white [/color][color=#007700]= [/color][color=#0000BB]ImageColorAllocate [/color][color=#007700]([/color][color=#0000BB]$im[/color][color=#007700], [/color][color=#0000BB]255[/color][color=#007700], [/color][color=#0000BB]255[/color][color=#007700], [/color][color=#0000BB]255[/color][color=#007700]);
[/color][color=#0000BB]$black [/color][color=#007700]= [/color][color=#0000BB]ImageColorAllocate [/color][color=#007700]([/color][color=#0000BB]$im[/color][color=#007700], [/color][color=#0000BB]128[/color][color=#007700], [/color][color=#0000BB]0[/color][color=#007700], [/color][color=#0000BB]0[/color][color=#007700]);
[/color][color=#FF8000]// draw on image
[/color][color=#0000BB]ImageFill[/color][color=#007700]([/color][color=#0000BB]$im[/color][color=#007700], [/color][color=#0000BB]0[/color][color=#007700], [/color][color=#0000BB]0[/color][color=#007700], [/color][color=#0000BB]$black[/color][color=#007700]);
[/color][color=#FF8000]// ImageLine($im, 0, 0, $width, $height, $white);
[/color][color=#0000BB]ImageString[/color][color=#007700]([/color][color=#0000BB]$im[/color][color=#007700], [/color][color=#0000BB]300[/color][color=#007700], [/color][color=#0000BB]15[/color][color=#007700], [/color][color=#0000BB]10[/color][color=#007700], [/color][color=#0000BB]$imagekod[/color][color=#007700], [/color][color=#0000BB]$white[/color][color=#007700]);
[/color][color=#FF8000]// output image
[/color][color=#0000BB]Header [/color][color=#007700]([/color][color=#DD0000]"Content-type: image/png"[/color][color=#007700]);
[/color][color=#0000BB]ImagePng [/color][color=#007700]([/color][color=#0000BB]$im[/color][color=#007700]);
[/color][color=#FF8000]// clean up
[/color][color=#0000BB]ImageDestroy[/color][color=#007700]([/color][color=#0000BB]$im[/color][color=#007700]);
[/color][color=#0000BB]?>[/color]
[/color]