How to use php to write a function requires that more than three consecutive identical characters will be filtered into two, and the regular expression will also work! For example, such as "good", "good", "very good, very good", and "very good, very good", ", "Is filtered into", ", such as" ~~~~~~~" Filtered to "~~", Include as many possibilities as possible! I am playing wordpress recently and want to avoid as many spam and meaningless comments as possible ~ ------ Solution --- how to use php to write a function requires that more than three consecutive identical characters will be filtered into two, and the regular expression will also work!
For example, such as "good", "good", "very good, very good", and "very good, very good", ", "Is filtered into", ", such as" ~~~~~~~" Filtered to "~~", Include as many possibilities as possible! I am playing wordpress recently and want to avoid as many spam and meaningless comments as possible ~
------ Solution --------------------
Discussion
Reference:
Echo preg_replace ("/(. +) \ 1 +/is", '$1 $ 1', $ s );
But I don't know ~~~~~~~~~ Why cannot It be processed?
. +? Yes
------ Solution --------------------
Discussion
Reference:
Reference:
Echo preg_replace ("/(. +) \ 1 +/is", '$1 $ 1', $ s );
But I don't know ~~~~~~~~~ Why cannot It be processed?
. +? Yes
Are you kidding?
PHP code
$ S = <TXT
For example, "good, good" is filtered into "good", like "very good, very good, very good "......
------ Solution --------------------
Haha, my memory is okay ....
Http://topic.csdn.net/u/20100302/22/A86F914D-AC19-4955-BC98-768C584EA800.html#r_63678078