count_chars (php 4, php 5, php 7, php 8) count_chars retorna informações sobre os caracteres usados em uma string
<?php
$data = "Two Ts and one F.";
foreach (count_chars($data, 1) as $i => $val) {
echo "There were $val instance(s) of \"" , chr($i) , "\" in the string.\n";
}
?>
SAMER SAEID