php - Auto spacebar after a word with over 50 characters
Is there a function that can automatically add a spacerbar if a word is over a certain number of characters? For example, given a word with 100 characters, it will post a spacebar at the 50th character. I am creating a comment system, and if someone posts something like:
it will mess up the look of my layout because there is no space in the word.
Use CSS instead of changing the actual word/string:
To answer with PHP, you can use a function like this one (if you really need to):