1. function imagettftextoutline(&$im,$size,$angle,$x,$y,&$col,$fontfile,$text,$width,&$outlinecol) {
  2.         // For every X pixel to the left and the right
  3.         $xd=0-abs($width);
  4.         for ($xc=$x-abs($width);$xc<=$x+abs($width);$xc++) {
  5.             // For every Y pixel to the top and the bottom
  6.             $yd=0-abs($width);
  7.             for ($yc=$y-abs($width);$yc<=$y+abs($width);$yc++) {
  8.                 //If this y x combo is within the bounds of a circle with a radius of $width
  9.                 //($xc*$xc + $yc*$yc) <= ($width * $width)+999
  10.                 if(($xd*$xd+$yd*$yd)<=$width*$width){
  11.                     // Draw the text in the outline color
  12.                     $text1 = imagettftext($im,$size,$angle,$xc,$yc,$outlinecol,$fontfile,$text);
  13.                 }
  14.                 $yd++;
  15.             }
  16.             $xd++;
  17.         }
  18.         // Draw the main text
  19.         $text2 = imagettftext($im,$size,$angle,$x,$y,$col,$fontfile,$text);
  20.     }  
  21.