Javatpoint Logo
Javatpoint Logo

PHP Imagecharup() Function

Imagecharup( ) function is another inbuilt PHP function that is mainly used to draw characters vertically. The function works using the x and y-axis, which are used to set coordinates for the starting point from where the picture has to be drawn. The origin coordinates (0, 0) are of the top left corner of the browsing window, and from the origin, we can set the coordinates to get the resulting picture according to our needs.

Syntax

Parameters

This function accepts six parameters which includes

S.No Parameter Description Optional / mandatory
1 $ image This parameter is used to define the size of the image that we want to display. This parameter is used by an image resource like the imagecreatetruecolor( ) function, which returns an image source. Mandatory
2 $ font This parameter is used to define the font size of the character that we want to display. It is used as numeric 1, 2, 3, etc., the higher the number, the large the font, and vice versa. optional
3 $ x This parameter is used to set the x coordinates of the desired image. Starting from the origin Mandatory
4 $ y This parameter is used to set the y coordinates of the desired image. Starting from the origin Mandatory
5 $ c This parameter is used to define the character, which will be printed Mandatory
6 $ color This parameter is used to define the color of the image. This parameter is used for creating a color identifies like the imagecolorallocate ( ) function optional

The imagecharup( ) function returns TRUE on successful execution of the program and FALSE on the failed attempt.

Examples

Program 1: PHP program to display the basic use of imagecharup( ) function.

Output

The above code gives the following output.

PHP Imagecharup() Function

Here in this program, we have declared various variables like $image to define the size of the image that we require, $background color to define the color of background we require, $text color to define the color of text we require. We have used the string( ) function to declare the string we want to display as an image. To display the output of the image, we have used an inbuilt PHP command header and imagepng to display on the browser.

Program 2: PHP program to display the use of imagecharup( ) function

Output

PHP Imagecharup() Function

Here in this program, we have declared various variables like $image to define the size of the image that we require, $background color to define the color of background we require, $text color to define the color of text we require. We have used the image string( ) function to declare the string we want to display as an image. To display the output of the image, we have used an inbuilt PHP command header and imagepng to display on the browser.

Program 3: PHP program to display the use of imagecharup( ) function

Output

PHP Imagecharup() Function

Here in this program, we have declared various variables like $image to define the size of the image that we require, $background color to define the color of background we require, $text color to define the color of text we require. We have used the image string ( ) function to declare the string we want to display as an image. To display the output of the image, we have used an inbuilt PHP command header and imagepng to display on the browser.

Program 4: PHP program to display the use of imagecharup( ) function

Output

PHP Imagecharup() Function

Here in this program, we have declared various variables like $image to define the size of the image that we require, $background color to define the color of background we require, $text color to define the color of text we require. We have used the image string ( ) function with a for loop to declare the complete string we want to display as an image. To display the output of the image, we have used an inbuilt PHP command header and imagepng to display on the browser.

Program 5: PHP program to display the use of imagecharup( ) function

Output

PHP Imagecharup() Function

Here in this program, we have declared various variables like $image to define the size of the image that we require, $background color to define the color of background we require, $text color to define the color of text we require. We have used the image string ( ) function with a for loop to declare the complete string we want to display as an image. To display the output of the image, we have used an inbuilt PHP command header and imagepng to display on the browser.







Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA