Total no de ocurrencias en la cadena PHP
$str = "cdcdcdcdeeeef";
echo substr_count($str, 'c');
//please note needle is case sensitive
uzii
$str = "cdcdcdcdeeeef";
echo substr_count($str, 'c');
//please note needle is case sensitive