<?php
$values = array(
40, 50, 20, 240, 60, 60, 240, 20, 50, 40, 10, 10 );
$image = imagecreatetruecolor(250, 250);
$bg = imagecolorallocate($image, 200, 200, 200);
$blue = imagecolorallocate($image, 0, 0, 255);
imagefilledpolygon($image, $values, 6, $blue);
header('Content-type: image/png');
imagepng($image);
imagedestroy($image);
?>
The above example will output
something similar to: