OK I am getting close! After reading on Stackoverflow here is what I have now:
http://www.autoshopgarage.com/new-era/test2.php?text=testing+%3Cb%3Escript%3C/b%3E%20this%20is%20so%20cool%20i%20love%20it
That does what I want, the only problem with this is now I can't get the wordwrap to work! It should wrap to the next line, but I cannot seem to get it.
Here is the new PHP code:
<?php
header('Content-type: image/png');
$im = imagecreatefrompng ( "banner_blank.png" );
$color = imagecolorallocate($image, 0, 0, 0);
$tmp = $_GET['text'];
$words = explode(" ", $tmp);
$x = array(0,0,230); // DUMMY ARRAY WITH X POSITION FOR FIRST WORD
$addSpace = 0;
foreach($words as $word)
{
if($addSpace) $word = " ".$word; // IF WORD IS NOT THE FIRST ONE, THEN ADD SPACE
if(stristr($word, "<b>"))
{
$font = 'HelveticaNeueLTStd-BdEx.ttf'; // BOLD FONT
$replace = str_replace(array("<b>","</b>"), "", $word);
$x = imagettftext($im, 20, 0, $x[2], 20, $color, $font, $replace);
}
else
{
$font = 'HelveticaNeueLTStd-LtEx.ttf'; // NORMAL FONT
$x = imagettftext($im, 20, 0, $x[2], 20, $color, $font, $word);
}
$addSpace = 1;
}
imagepng($im);
imagedestroy($im);
?>
Anyone have any ideas?
Thanks!