I have to make an image in GD based upon some text taken out of a DB. However, it has to be small enough to fit on one line, or wrap to the next.
The wordwrap will not work for this, obviously, as I have to pass a new variable to Imagettftext for each new line.
I can check the text for length, and if it is longer, use preg_split to split it at the spaces. But, it then splits EVERY bit of text after whatever I set my strlen to check.
Like this:
If I put in, say, David Bowie And The Stranglers, I would like it to see this string is more than 10-letters long. then, to break it up into seperate lines strings each of which are at maximum 10 carchters long AND break on a space.
The way it sits now, it looks like
David
Bowie
And
The
Stranglers
which is worse.
Any thoughts?