String char count : Char « Data Type « PHP






String char count

<?
$twister = "Peter Piper picked a peck of pickled peppers";
print("$twister<BR>");
$letter_array = count_chars($twister, 1);

while ($cell = each($letter_array)){
  $letter = chr($cell['key']);
  $frequency = $cell['value'];
  print("Character: '$letter'; frequency:  $frequency<BR>");
}
?>

           
       








Related examples in the same category

1.Predefined Characters and Classes