The imagechar() function is an inbuilt function in PHP which is used to draw a character horizontally. This function draws the first character of string in the image identified by image with its x and y-axis. The coordinate of the top-left corner is (0, 0).
bool imagechar( $image, $font, $x, $y, $c, $color )
Parameters: This function accepts six parameters as mentioned above and described below:
- $image: It is returned by one of the image creation functions, such as imagecreatetruecolor(). It is used to create size of image.
- $font: This parameter is used to set font size of character. Its value can be 1, 2, 3, 4, 5 for built-in fonts in latin2 encoding. The higher numbers represents the larger fonts and small number represent small font.
- $x: This parameter is used to set x-coordinate to print character in image.
- $y: This parameter is used to set y-coordinate to print character in image.
- $c: The character which is printed.
- $color: It sets the color of image. A color identifier created by imagecolorallocate() function.
Return Value: This function returns true on success or false on failure.
Below programs illustrate the imagechar() function in PHP:
- How to get the function name inside a function in PHP ?
- p5.js | sin() function
- p5.js | nfc() function
- D3.js | d3.set.has() Function
- p5.js | log() function
- p5.js | nf() Function
- p5.js | red() function
- PHP Ds\Set get() Function
- D3.js | d3.map.set() Function
- PHP | next() Function
- p5.js | cos() function
- PHP | Ds\Map last() Function
- D3.js | d3.max() function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.