  | 
		 		   | 
	  	    
          
            
			
	
			
			 
                ช่วยดู code ให้หน่อยครับ ตรง imagestring ผมอยากเปลี่ยนไปใช้ imagettftext เพื่อปรับตัวขนาดตัวหนังสือ แต่พอทำแล้ว ภาพมันไม่ขึ้นเลย ผมอยากรู้ต้องแก้ตรงไหนบ้างครับ 
Code (PHP) 
<?php
session_start();
function random_password($len)
{
	srand((double)microtime()*10000000);
	$chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
	$ret_str = "";
	$num = strlen($chars);
	for($i = 0; $i < $len; $i++)
	{
		$ret_str.= $chars[rand()%$num];
		$ret_str.=""; 
	}
	return $ret_str; 
}
$code = random_password(5); 
// $code=rand(1000,9999);
$_SESSION["code"]=$code;
$im = imagecreatetruecolor(200, 50);
$bg= imagecolorallocate($im, 144, 238, 144);  
imagefilledrectangle($im,0,0,200,100,$bg);
$pixel_color = imagecolorallocate($im, 0,0,255);
for($i=0;$i<800;$i++) {
    imagesetpixel($im,rand()%200,rand()%50,$pixel_color);
} 
$fg = imagecolorallocate($im, 0, 0, 0);
imagestring($im, 5, 75, 20,  $code, $fg);
header("Cache-Control: no-cache, must-revalidate");
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>
 
 
  Tag : PHP               
                        | 
           
          
            | 
			
                             | 
           
          
            
              
                   | 
                   | 
                   | 
               
              
                   | 
                
                    
                      | Date :
                          2018-03-07 18:02:45 | 
                      By :
                          rayking03 | 
                      View :
                          720 | 
                      Reply :
                          3 | 
                     
                  | 
                   | 
               
              
                   | 
                   | 
                   | 
               
              | 
           
          
            | 
			 | 
           
         
	    
		             | 
		
			  |