Page 1 of 1

Unusual text wrapping problem

Posted: Fri Aug 01, 2008 3:04 pm
by AnotherAlex
Hello everyone!

I whave a following problem: when trying to wrap a text with tags, a function sometimes places <br /> inside a tag, like this: "<a<br /> href...."

How can I avoid it? I've searched the forums for "wrap text tags" keywords, but found no similar topics.

Thank you!

Re: Unusual text wrapping problem

Posted: Fri Aug 01, 2008 3:13 pm
by nowaydown1
I would take a look at the wordwrap docs on php.net. Looks like there's a few guys on there who have posted workarounds for the problem you describe: http://us.php.net/wordwrap

Re: Unusual text wrapping problem

Posted: Fri Aug 01, 2008 6:01 pm
by omniuni
A little more info would be great, but you could try striptags() on it, and allow "a" but not "br". That should give you clean links, without br's in them.

Re: Unusual text wrapping problem

Posted: Sun Aug 03, 2008 12:44 pm
by AnotherAlex
Thank you! I will definitely have a look at php.net discussion.