imagearc() function in PHP

The imagearc() function is used to draw an arc.

Syntax

imagearc( $img, $cx, $cy, $width, $height, $start, $end, $color )

Parameters

  • $img: Creates an image with imagecreatetruecolor().

  • $cx: x-coordinate of the center.

  • $cy: y-coordinate of the center.

  • $width: The width of arc.

  • $height: The height of arc.

  • $start: The arc start angle, in degrees.

  • $end: The arc end angle in degrees.

  • $color: It sets the color of image.

Return

The imagearc() function returns the 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 have different coordinates and angle for arc:

Output

The following is the output:

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

398 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements