imagechar() function in PHP

The imagechar() function draws a character horizontally.

Syntax

bool imagechar( img, font, x, y, ch, color )

Parameters

  • img: Creating an image with imagecreatetruecolor().

  • font: Set font size

  • x: x-coordinate

  • y: y-coordinate

  • c: The character to draw.

  • color: A color identifier created with imagecolorallocate().

Return

The imagechar() function returns TRUE on success or FALSE on failure.

Example

The following is an example:

Output

The following is the output:

Example

Let us see another example wherein we are drawing a character with different coordinates and height/ width as shown in the above example:

Output

The following is the output:

Updated on: 2019-12-31T07:38:45+05:30

194 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements