看看网上的文章吧
很多的
用gd函数

解决方案 »

  1.   

    哪个随机吗?不过还是给你一个例子,你要的可能是这个<?php
    Header(  "Content-type:  image/PNG  "); 
    srand((double)microtime()*1000000);
    $randval = rand();//随机数生成方式及位数可自己写   
    $im  =  imagecreate(50,25);    
    $bkg  =  ImageColorAllocate($im,  200,200,200);
    $black  =  ImageColorAllocate($im,  0,0,0);  
    $white  =  ImageColorAllocate($im,  255,255,255);  
    imageline($im,  1,  1,  80,  25,  $black);  
    imageline($im,  1,  1,  60,  80,  $black); 
    imagearc($im,  20,  5,  5,  20,  35,  190,  $black);  
    imagestring($im,5,5,5,$randval,  $white);  
    ImagePNG($im);    
    ImageDestroy($im); 
    ?>