Sure it's not a problem... This is something very quick that I whipped up:
<?php
$radius = 100;
$p_green = 30;
$image = @imagecreate (2 * $radius + 1, 2 * $radius + 1);
$white = @imagecolorallocate ($image, 255, 255, 255);
$black = @imagecolorallocate ($image, 0, 0, 0);
$green = @imagecolorallocate ($image, 0, 255, 0);
$red = @imagecolorallocate ($image, 255, 0, 0);
@imagefilledrectangle ($image, 0, 0, 2 * $radius + 1, 2 * $radius + 1, $white);
@imagefilledarc ($image, $radius, $radius, 2 * $radius, 2 * $radius, 0, 3.6 * $p_green, $green, IMG_ARC_PIE);
@imagefilledarc ($image, $radius, $radius, 2 * $radius, 2 * $radius, 3.6 * $p_green, 360, $red, IMG_ARC_PIE);
$text_g = @imagettfbbox (10, 0, './arial.ttf', $p_green . '%');
@imagettftext ($image, 10, 0, 170, 180 - $text_g[7], $black, './arial.ttf', $p_green . '%');
$text_r = @imagettfbbox (10, 0, './arial.ttf', (100 - $p_green) . '%');
@imagettftext ($image, 10, 0, 30 - $text_r[2], 20, $black, './arial.ttf', (100 - $p_green) . '%');
@imageellipse ($image, $radius, $radius, 2 * $radius, 2 * $radius, $black);
header ('Content-type: image/png');
@imagepng ($image);
@imagedestroy ($image);
?>
Now the downside to this code is that it always puts the numbers in the same place (and of course, you could put a name in that place rather than the percentage)... so if the green portion is only 5%, both labels will "look like" they're labeling the red section.