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!
Unusual text wrapping problem
Moderator: General Moderators
-
AnotherAlex
- Forum Newbie
- Posts: 2
- Joined: Fri Aug 01, 2008 2:54 pm
-
nowaydown1
- Forum Contributor
- Posts: 169
- Joined: Sun Apr 27, 2008 1:22 am
Re: Unusual text wrapping problem
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
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.
-
AnotherAlex
- Forum Newbie
- Posts: 2
- Joined: Fri Aug 01, 2008 2:54 pm
Re: Unusual text wrapping problem
Thank you! I will definitely have a look at php.net discussion.