I am using the GD function to generate text on a PNG image. I can get it work without problems, but I have more than one item of text I want to display. For example, but image has 4 squares and I want to place different text into each square. How can I do that?
I tried using the imagettftext() function more than once, but it generated an error and nothing displayed but the red x in the top left of where the PNG image should have been.
As you can see the commented portion I have the variable $text2 and $two = .... I have tried it both ways with the variable in front of the function and without the variable infront of the function. Either way, the second time I try to put in imagettftext() it generates and error.
Can anyone help me figure this out?
$im = imagecreatefrompng ("Legaloval20.png");
$color = imagecolorallocate($im, 0, 0, 0);
$text = $_GET['text'];
$size = 14;
// angle x y
$one = imagettftext($im, $size, 10, 144, 123, $color, $font, $text);
//$text2 = "Spaces"
//$two = imagettftext($im, $size, 10, 164, 143, $color, $font, $text2);