I need to set a maximum line length of a string. For example if the string is "Testing Test Tester Test" and I want only 5 characters per string, it needs to knock the next line down. I also need it to keep words together if it's under the 5 characters possible. So it would be:
"Testi
ng
Test
Teste
r
Test"
I'm using imagettftext() to create a box of text over a graphic, but there has to be a limit to how long each line of text is, and I just can't figure this out.
Drop Text Down a Line after so many characters
Moderator: General Moderators
-
jasonfarrell
- Forum Newbie
- Posts: 3
- Joined: Fri Jan 23, 2004 5:09 pm
wordwrap() which gives you the option to choose your line cutter (defaults to \n, so you're good with the default) and the option to keep whole words.
also str_split() (php >= 5) and some nifty checks for whole words (checking for spaces)
also str_split() (php >= 5) and some nifty checks for whole words (checking for spaces)
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.