Hello. I am actually trying to create images with PHP and have it create an image with multiple lines of text into the image itself. I have seen the ability to create ONE line of text, but not multiple lines within the same image. Anyone heard of this? I've tried placing a carriage return (\n) within the sting, but that doesn't work.
Here is some code that creates ONE line of text:
$text='PHP is Cool';
Header("Content-type: image/gif");
if(!isset($s)) $s=11;
$size = imagettfbbox($s,0,"Arial",$text);
$dx = abs($size[2]-$size[0]);
$dy = abs($size[5]-$size[3]);
$xpad=9;
$ypad=9;
$im = imagecreate($dx+$xpad,$dy+$ypad);
$blue = ImageColorAllocate($im, 0x2c,0x6D,0xAF);
$black = ImageColorAllocate($im, 0,0,0);
$white = ImageColorAllocate($im, 255,255,255);
ImageRectangle($im,0,0,$dx+$xpad-1,$dy+$ypad-1,$black);
ImageRectangle($im,0,0,$dx+$xpad,$dy+$ypad,$white);
ImageTTFText($im, $s, 0, (int)($xpad/2)+1, $dy+(int)($ypad/2), $black, "Arial", $text);
ImageTTFText($im, $s, 0, (int)($xpad/2), $dy+(int)($ypad/2)-1, $white, "Arial", $text);
ImageJPEG($im);
ImageDestroy($im);
Anyone have any ideas?
Thanks!
Robert