<?php

  header
("Content-type: image/png");  
//이미지 타입에 맞도록 해더 구성

 
$im = imagecreate(400, 30);
// 이미지 기본 판 만들기

 
$white = imagecolorallocate($im, 255, 255, 255);
//색상

 
$black = imagecolorallocate($im, 0, 0, 0);
//색상

 
$bg = imagecolorallocate($im, 0xF2, 0xE2, 0xD2);
//색상 16진수 사용

  // Replace path by your own font path

 
$str_input = "한글은 잘되나? English output is well. 月火水木金土日"
;

 
$str_input = iconv("EUC-KR","UTF-8",$str_input);
// UTF-8로 한글 변경

 
imagefill($im,0,0, $bg);
//배경 칠하기

 
imagettftext($im, 10, 0, 10, 20, $black, "/gulim.ttc",$str_input);
//글자 적기

 
imagepng($im);
//png 형식으로 이미지 표시

 
imagedestroy($im);
//이미지 제거

?>
Posted by 알 수 없는 사용자
,