Is there a way of replacing multiple instances of a character with just one character from a user's form input.
Example:
Here is my description.........................................................
Replace the multiple instances of the '.' with just one.
Thanks,
Stuart
$string = preg_replace("/.+/", ".", $string);
That should do it. Replacing every occourance of . or multiple . with a single .
You might not have to escape the . in the replacement, but then again you might.