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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -