Hello everybody,
i need help from you guys.. I want to split text line into 2-3 lines and put it on image using GD. I know how to write text on image with GD, but i don't know how to split text to get the last line..
Here is what it should look like:
If text line exceeds limited width as example 200px then it should split text into two lines and if the second line also exceeds limited width then it should split second line too making 3 text lines of 1.
I can't use wordwrap, because then i cant center last line.. As example there is a text line: "Are you posting in the most appropriate place to receive relevant replies? This is the PHP Forum."
And if i try to use wordwrap then ir looks like this:
"Are you posting in the most
appropriate place to receive
relevant replies? This is the
PHP Forum."
So i cant center last line.. Splited text should look like:
"Are you posting in the most
appropriate place to receive
relevant replies? This is the
PHP Forum."
I know how to center text on image, but HOW i can get the last line to center it? If somehow i could get it then i would use variable like $firstline and $secondline in imagettftext
imagettftext($image_2,$font_size6,0,$x-10,$image_height-100,$black,$font3,$firstline);
imagettftext($image_2,$font_size4,0,$x2+3,$image_height-55,$black,$font4,$secondline);
Thank you in advance! :)