ok well I'll have text like this that I pull from a query.....
$str = "[tag1]text text text text[/tag1] text text text text text text[tag2="text"]text text[/tag2] text text";
and I want to feed this through a word wrapping function and end up with something like this
$str = "[tag1]text text text text[/tag1]<br>
text text text text<br>
text text [tag2="text"]text text[/tag2]<br>
text text";
Thus to the viewer the lines appear to be wrapped to the same length rather than wrapped according the the lenght including the tags. So I think one way I could do this is by using a regular expression to extract all the tags the compare and record the position of each tag, send the tagless string through wordwrap, then feed the tags back into it.
It seems like it might get a little messy so I was trying to find an easier way of doing it.