How to get length of the longest sequence with same characters in a string?
- by SpawnCxy
To be specified:
function getLength($str)
{
//function i need
}
$str1 = 'aabbcccc';
$str2 = 'aabbccccaaaaa';
echo getLength($str1); //will get 4
echo getLength($str2); //will get 5
Any good ideas?Thanks in advance!