imagearc — used to draw elliptical arcs.
bool imagearc ( resource $image , int $cx , int $cy , int $w , int $h , int $s , int $e , int $color )
imagearc() draws an elliptical arc in the image represented by image with cx, cy (the upper left corner of the image is 0, 0) as the center.
w and h specify the width and height of the ellipse respectively, and the start and end points are specified in angles with the s and e parameters. 0° is at three o'clock and is drawn in a clockwise direction.
<?php$img = imagecreatetruecolor(200, 200); // Create a 200*200 image $white = imagecolorallocate($img, 255, 255, 255); // Color // Draw an elliptical arc imagearc($img, 140 , 75, 50, 50, 0, 360, $white);// The browser outputs the image header("Content-type: image/png");imagepng($img);imagedestroy($img);?>
The picture of the output result of the above example is as follows: