String char count : Char : Language Basics PHP Source Code


PHP Source Code » Language Basics » Char »

 

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>");
}
?>

           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Language Basics
» Char