imagechar — writes characters horizontally.
bool imagechar ( resource $image , int $font , int $x , int $y , string $c , int $color )
imagechar() draws the first character of the string c in the image specified by image, with its upper left corner located at x, y (the upper left corner of the image is 0, 0), and its color is color. If font is 1, 2, 3, 4 or 5, the built-in font is used (higher numbers correspond to larger fonts).
<?php$im = imagecreate(100,100);$string = 'PHP';$bg = imagecolorallocate($im, 255, 255, 255);$black = imagecolorallocate($im, 0, 0, 0);// The upper left corner output character Pimagechar($im, 5, 0, 0, $string, $black);header('Content-type: image/png');imagepng($im);?>
The picture of the output result of the above example is as follows: