Hello!
I need a little help for a way to remove multiple characters from a string.
A letter can be written up to 5 times for example, a number 15 times,
but all other characters max 2 times.
For example:
!!!!!!!!!!!! should become
!
coooooooooooooooooooool should become
coooool
I could make this:
PHP Code:
$text = preg_replace( "/\!{1,}/", "!", $text );
to remove multiple
"!"
But do I have to write this line for each character? There must be an easier way, maybe several lines but not one for each character.
Thank you for any help!
With regards, Boby!