PHP Imagearc() FunctionImagearc( ) function is another inbuilt PHP function mainly used to draw an arc of a circle with a particular center and given coordinates. The function works using the x and y-axis, 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 arc according to our needs. The function returns Boolean values true on success and false on failure. Syntax ParametersThis function accepts these eight parameters.
The imagearc( ) function returns TRUE on successful execution of the program and FALSE on a failed attempt. Program 1: PHP program to display the basics of imagearc( ) function Output The above code gives the following output. Here in this program, we have declared various variables like $image to define the size of the image that we require, $ image - color -1, and $ image - color - 2 to define the color of arc we require. We have used the imagearc( ) function to declare the arc 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 basics of imagearc( ) function Output Here in this program, we have declared various variables like $image to define the size of the image that we require, $ image - color -1, and $ image - color - 2 to define the color of arc we require. We have used the imagearc( ) function to declare the arc 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 basics of imagearc( ) function Output Here in this program, we have declared various variables like $image to define the size of the image that we require, $ image - color -white, $ image - color - red, $ image - color - green, and $ image - color - blue to define the color of arc we require. We have used the imagearc( ) function to declare the arc we want to display and created a face using the image arc () function. 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 basics of imagearc( ) function Output: Here in this program, we have declared various variables like $image to define the size of the image that we require, we have declared $background-color to assign a background color and $ image - color -white, $ image - color - red, $ image - color - green and $ image - color - blue to define the color of arc we require. We have used the imagearc( ) function to declare the arc we want to display and created a face using the image arc () function. To display the output of the image, we have used an inbuilt PHP command header and imagepng to display on the browser. Program5: PHP program to display the basics of imagearc( ) function Output: Here in this program, we have declared various variables like $image to define the size of the image that we require, we have declared $background-color to assign a background color and $ image - color -white, $ image - color - red, and $ image - color - black to define the color of arc we require. We have used the imagearc( ) function to declare the arc we want to display and created a face using the image are () function. To display the output of the image, we have used an inbuilt PHP command header and imagepng to display on the browser. Next TopicPHP Imagecharup() Function |