演示地址 https://www.zhoulegeyi.com/table/qizheng.htm
1 $x=250; 2 $y=250; 3 $html=''; 4 $html.=' 5 <circle cx="'.$x.'" cy="'.$y.'" r="90" fill="#fff" stroke="grey" stroke-width="1"/> 6 <circle cx="'.$x.'" cy="'.$y.'" r="70" fill="#dbe6cf" stroke="grey" stroke-width="1"/> 7 <circle cx="'.$x.'" cy="'.$y.'" r="50" fill="#fff" stroke="grey" stroke-width="1"/>'; 8 //十二宫分割线 9 for($i=0;$i<6;$i++) 10 { 11 $j=$i*30; 12 $l1=$x-120; 13 $l2=$x+120; 14 $html.='<line x1="'.$l1.'" y1="'.$y.'" x2="'.$l2.'" y2="'.$y.'" style="stroke:grey;stroke-width:1" transform="rotate('.$j.' '.$x.' '.$y.')" />'; 15 } 16 //十二地支、星座,文字 17 $xzAr=array('','天枰','处女','狮子','巨蟹','双子','金牛','白羊','双鱼','水平','摩羯','射手','天蝎'); 18 $gongAr=array('','相貌','福德','官禄','迁移','疾厄','夫妻','奴仆','男女','田宅','兄弟','财帛','命宫'); 19 $dzAr=array('','辰','巳','午','未','申','酉','戌','亥','子','丑','寅','卯'); 20 for($i=1;$i<=12;$i++) 21 { 22 $j=13-$i; 23 $k=($i-1)*30+15; 24 $sin=sin(deg2rad($k)); 25 $cos=cos(deg2rad($k)); 26 $kx=$x-$cos*38; 27 $ky=$y-$sin*38; 28 $gx=$x-$cos*58; 29 $gy=$y-$sin*58; 30 $lx=$x-$cos*78; 31 $ly=$y-$sin*78; 32 $r=Xiu(255+$i*30,360); 33 $html.='<text x="'.$kx.'" y="'.$ky.'" fill="#8a5f0e" style="dominant-baseline:middle;text-anchor:middle;font-size:12" transform="rotate('.$r.','.$kx.','.$ky.')">'.$dzAr[$i].'</text> 34 <text x="'.$gx.'" y="'.$gy.'" fill="#8a5f0e" style="dominant-baseline:middle;text-anchor:middle;font-size:12" transform="rotate('.$r.','.$gx.','.$gy.')">'.$xzAr[$i].'</text> 35 <text x="'.$lx.'" y="'.$ly.'" fill="#8a5f0e" style="dominant-baseline:middle;text-anchor:middle;font-size:12" transform="rotate('.$r.','.$lx.','.$ly.')">'.$gongAr[$i].'</text>'; 36 } 37 $html.='<circle cx="'.$x.'" cy="'.$y.'" r="30" fill="#fff" stroke="grey" stroke-width="1"/>'; 38 return $html;
标签:gongAr,SVG,四余,html,七政,250,array From: https://www.cnblogs.com/zhoulegeyi/p/17858534.html