php8.5
Home/ Manual/ image / functions/ imagecharup

imagecharup

PHP function Edit on GitHub ✎

(PHP 4, PHP 5, PHP 7, PHP 8)

Draw a character vertically

Description

imagecharup(GdImage $image, GdFont|int $font, int $x, int $y, string $char, int $color): true

Draws the character char vertically at the specified coordinate on the given image.

Parameters

x

x-coordinate of the start.

y

y-coordinate of the start.

char

The character to draw.

color

Color

Return Values

Always

Changelog

VersionDescription

Examples

imagecharup() example

php
<?php

$im = imagecreate(100, 100);

$string = 'Note that the first letter is a N';

$bg = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);

// prints a black "Z" on a white background
imagecharup($im, 3, 10, 10, $string, $black);

header('Content-type: image/png');
imagepng($im);

?>

The above example will output something similar to: Output of example : imagecharup()

See Also

Source: reference/image/functions/imagecharup.xml · from the official PHP manual (php/doc-en)