PHP how to check there are more than 2 running same chars in a string -


checking if string has more running 1 occurrence of same character. iiiiiiii or ssssss. maybe use preg_match pattern should be?

try regex:

$str = 'hello'; print preg_match('/([\w])\1{1,}/', $str); /*return true */ 

Comments