You can use the imagepatternedline() function with extra features instead of imagedashedline() to give a visible dashedlines and other any kind of patterned lines on your images. The routine also manages the thickness of the line. Have fun!
<?php
function imagepatternedline($image, $xstart, $ystart, $xend, $yend, $color, $thickness=1, $pattern="11000011") {
$pattern=(!strlen($pattern)) ? "1" : $pattern;
$x=$xend-$xstart;
$y=$yend-$ystart;
$length=floor(sqrt(pow(($x),2)+pow(($y),2)));
$fullpattern=$pattern;
while (strlen($fullpattern)<$length) $fullpattern.=$pattern;
if (!$length) {
if ($fullpattern[0]) imagefilledellipse($image, $xstart, $ystart, $thickness, $thickness, $color);
return;
}
$x1=$xstart;
$y1=$ystart;
$x2=$x1;
$y2=$y1;
$mx=$x/$length;
$my=$y/$length;
$line="";
for($i=0;$i<$length;$i++){
if (strlen($line)==0 or $fullpattern[$i]==$line[0]) {
$line.=$fullpattern[$i];
}else{
$x2+=strlen($line)*$mx;
$y2+=strlen($line)*$my;
if ($line[0]) imageline($image, round($x1), round($y1), round($x2-$mx), round($y2-$my), $color);
$k=1;
for($j=0;$j<$thickness-1;$j++) {
$k1=-(($k-0.5)*$my)*(floor($j*0.5)+1)*2;
$k2= (($k-0.5)*$mx)*(floor($j*0.5)+1)*2;
$k=1-$k;
if ($line[0]) {
imageline($image, round($x1)+$k1, round($y1)+$k2, round($x2-$mx)+$k1, round($y2-$my)+$k2, $color);
if ($y) imageline($image, round($x1)+$k1+1, round($y1)+$k2, round($x2-$mx)+$k1+1, round($y2-$my)+$k2, $color);
if ($x) imageline($image, round($x1)+$k1, round($y1)+$k2+1, round($x2-$mx)+$k1, round($y2-$my)+$k2+1, $color);
}
}
$x1=$x2;
$y1=$y2;
$line=$fullpattern[$i];
}
}
$x2+=strlen($line)*$mx;
$y2+=strlen($line)*$my;
if ($line[0]) imageline($image, round($x1), round($y1), round($xend), round($yend), $color);
$k=1;
for($j=0;$j<$thickness-1;$j++) {
$k1=-(($k-0.5)*$my)*(floor($j*0.5)+1)*2;
$k2= (($k-0.5)*$mx)*(floor($j*0.5)+1)*2;
$k=1-$k;
if ($line[0]) {
imageline($image, round($x1)+$k1, round($y1)+$k2, round($xend)+$k1, round($yend)+$k2, $color);
if ($y) imageline($image, round($x1)+$k1+1, round($y1)+$k2, round($xend)+$k1+1, round($yend)+$k2, $color);
if ($x) imageline($image, round($x1)+$k1, round($y1)+$k2+1, round($xend)+$k1, round($yend)+$k2+1, $color);
}
}
}
?>