Lets say that I've got a string, $mystring, with lots of text, including a couple of very long words.
I want a function that splits all long words, so that there are no words larger than 40 characters, in the string.
BUT! I want everything that is between the < and > tags to stay unaffected by the function. So if I have a very long URL in an IMG src-tag or A href-tag, the URL may not be split.
Hope that you can help me.
Thanx in advance
Split long words in strings WITHOUT ruining HTML
Moderator: General Moderators
What your probably looking for is some hyphenation... there is one script at hotscripts.com (http://www.hotscripts.com/Detailed/14316.html) - I personally haven't used it, but it might be worth a look. With some tweaking it might be able to do what you need.