(PHP 4, PHP 5, PHP 7)
imagestring — 水平锟截伙拷一锟斤拷锟街凤拷锟斤拷
$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(100, 30);
// 锟斤拷色锟斤拷锟斤拷锟斤拷锟斤拷色锟侥憋拷
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 255);
// 锟斤拷锟街凤拷锟斤拷写锟斤拷图锟斤拷锟斤拷锟较斤拷
imagestring($im, 5, 0, 0, "Hello world!", $textcolor);
// 锟斤拷锟酵硷拷锟�
header("Content-type: image/png");
imagepng($im);
?>
锟轿硷拷 imageloadfont() 锟斤拷 imagettftext()锟斤拷