I am new to PHP and have a question.
I've made a chat-like application, it is working well but i can't seem to find exactly what i want to do in searching previous threads.
The user can input from a form field their $message. So...
$message = $_POST['message'];
The input box allows a maximum of 600 characters. Now if the user posts nothing but one long entire string that doesn't contain any white space, or spaces between any of the string characters.. short example..
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
If it goes to a certain length, it causes the page to break by creating a horizontal scroll frame.
How can I take $message and filter it so that it will break this up? But also taking into account that most users are posting a real $message, and not to accidentally split up any valid words etc. maybe something that checks to see if one of the $message array elements is longer than xxx amount of characters long and if so break it up? Or what's the easiest way to go about this?