@$hos=iconv("GBK", "UTF-8", $_GET["hos"]);
if(!isset($hos))
exit;
$im=ImageCreate(150,150);
$gray=ImageColorResolveAlpha($im,200,200,200,127);
$red=ImageColorAllocate($im,230,150,150);
for($i=0;$i<6;$i++)
ImageArc($im,75,75,148-$i,148-$i,0,360,$red);
$stock='C:\WINDOWS\Fonts\simkai.ttf';
$point="★";
$size=30;
ImageTTFText($im,$size,0,72-$size/2,72+$size/2,$red,$stock,$point);
$a=75;$b=-75;//中心点坐标
$r=65;$m=40;//半径,角度
$size=16;//字体大小
$r=$r-$size;
$word=array();
$max=18;
$count=mb_strlen($hos,'utf8');
if($count>$max)$count=$max;
if($count>12)
$m=floor(360/$count);
else if($count>5)
$m-=$count;
for($i=0;$i
$word[]=mb_substr($hos,$i,1,'utf8');
$j=floor($count/2);
if($j!=$count/2)
{
for($i=$j;$i>=0;$i--)
{
$arc=$m*($j-$i)+$size/2;
$x=round($r*cos((90+$arc)*M_PI/180))+$a;
$y=-1*(round($r*sin((90+$arc)*M_PI/180))+$b);
if($arc<10)$arc=0;
ImageTTFText($im,$size,$arc,$x,$y,$red,$stock,$word[$i]);
$arc=$m*($j-$i)-$size/2;
$x=round($r*cos((90-$arc)*M_PI/180))+$a;
$y=-1*(round($r*sin((90-$arc)*M_PI/180))+$b);
if($arc<10)$arc=0;
ImageTTFText($im,$size,-$arc,$x,$y,$red,$stock,$word[$j+$j-$i]);
}
}
else
{
$j=$j-1;
for($i=$j;$i>=0;$i--)
{
$arc=$m/2+$m*($j-$i)+$size/2;
$x=round($r*cos((90+$arc)*M_PI/180))+$a;
$y=-1*(round($r*sin((90+$arc)*M_PI/180))+$b);
ImageTTFText($im,$size,$arc,$x,$y,$red,$stock,$word[$i]);
$arc=$m/2+$m*($j-$i)-$size/2;
$x=round($r*cos((90-$arc)*M_PI/180))+$a;
$y=-1*(round($r*sin((90-$arc)*M_PI/180))+$b);
ImageTTFText($im,$size,-$arc,$x,$y,$red,$stock,$word[$j+$j+1-$i]);
}
}
header('Content-Type:image/png');
ImagePNG($im);
?>