imagestring

(PHP 4, PHP 5, PHP 7)

imagestring水平锟截伙拷一锟斤拷锟街凤拷锟斤拷

说锟斤拷

imagestring ( resource $image , int $font , int $x , int $y , string $s , int $col ) : bool

imagestring() 锟斤拷 col 锟斤拷色锟斤拷锟街凤拷锟斤拷 s 锟斤拷锟斤拷 image 锟斤拷锟斤拷锟斤拷锟酵硷拷锟斤拷 x锟斤拷y 锟斤拷锟疥处锟斤拷锟斤拷锟斤拷锟街凤拷锟斤拷锟斤拷锟较斤拷锟斤拷锟疥,锟斤拷锟斤拷图锟斤拷锟斤拷锟斤拷辖锟轿� 0锟斤拷0锟斤拷锟斤拷锟斤拷锟� font 锟斤拷 1锟斤拷2锟斤拷3锟斤拷4 锟斤拷 5锟斤拷锟斤拷使锟斤拷锟斤拷锟斤拷锟斤拷锟藉。

Example #1 imagestring() 锟斤拷锟斤拷

<?php
// 锟斤拷锟斤拷一锟斤拷 100X30 锟斤拷图锟斤拷
$im imagecreate(10030);

// 锟斤拷色锟斤拷锟斤拷锟斤拷锟斤拷色锟侥憋拷
$bg imagecolorallocate($im255255255);
$textcolor imagecolorallocate($im00255);

// 锟斤拷锟街凤拷锟斤拷写锟斤拷图锟斤拷锟斤拷锟较斤拷
imagestring($im500"Hello world!"$textcolor);

// 锟斤拷锟酵硷拷锟�
header("Content-type: image/png");
imagepng($im);
?>

锟轿硷拷 imageloadfont() 锟斤拷 imagettftext()锟斤拷