...this version does not have to mess around with imagerotate and allows you to refer to any true type font you want to use (if you have access to it or can add it to the directory).
_func_gd_create_vcol.php
<?php
//$col_key="I am a vertical column head. jpg"; //just a test value
$filename2="$col_key.jpg";
//if(file_exists($filename2)) {} else {
$font = 'Arial.ttf';
$fsize=12;
//(fontsize,angle,font,text)
$tb=imagettfbbox($fsize, 90, $font, $col_key); //gets an array of numbers...some can be used to define image size
$width=(abs($tb[4])*1.3);
$height=(abs($tb[5])); //create a space for lowercase letters that go below base
$im = imagecreatetruecolor($width, $height);
$white=imagecolorallocate($im, 255, 255, 255);
$navy =imagecolorallocate($im, 0,0,128 );
imagefilledrectangle($im, 0, 0, $width, $height, $navy);
imagettftext($im, $fsize, 90, abs($tb[4]), $height, $white, $font, $col_key);
imagejpeg($im, $filename2); //save the image for future use.
//} //end the test for the existance of the file
//echo "<img src=\"$filename2\">"; //test: view the image that was created
?>
...that's it!