Come across a problem on one of my sites with a feed. One of my users has put in a post where for the purposes of underlining she has put in umpteen "-" characters (where one <hr> would have sufficed, alas). As a result of this the format on the front page is temporarily knocked out of alignment.
This data is held within a MySql database, and a number of conditions are put on the parsed text already, e.g. strip_tags.
What would be the best answer to this problem?
So far I've considered:
1) Cheating by using the wordwrap command.
2) Cheating by using ereg_replace or preg_replace to take the "-" character out of the feed.
But I figure there must be a better way to do this, just haven't been able to find it. Can anyone suggest one?
P.S. I would probably make a limit of twenty characters to a word, that seems a reasonable amount.
Removing long words from a string
Moderator: General Moderators
html Area
If you are considering style textarea you might also want to try out this html Area :
http://www.interactivetools.com/products/htmlarea/
Its amazing with lots of functionality including <HR>.
http://www.interactivetools.com/products/htmlarea/
Its amazing with lots of functionality including <HR>.
- Toneboy
- Forum Contributor
- Posts: 102
- Joined: Wed Jul 31, 2002 5:59 am
- Location: Law, Scotland.
- Contact:
Got this tip from a friend of mine:
Code: Select all
// In this example words 25 characters or longer are not shown.
$newstext = preg_replace("/[a-zA-Z0-9]{25,}/s", "", $newstext);