I have been asked to solve this question. Please suggest me how to solve this.
$string = "kkjnmnmnjjjnmn";
here I need to find consecutively repeated string of length 3. for example - kkj has occurred only once and jnm 2 times and nmn 3 times.
Starting from first character, going in right side direction, 3 consecutive characters which are repeated more than once should be the output.
Preg_match_all will result as nmn - 2 times and not as 3 times.
How to solve this?