Split long words in strings WITHOUT ruining HTML
Posted: Sat Mar 08, 2003 8:18 am
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
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