Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

String char count

Mon Oct 27, 2008 12:32 pm

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




Post a reply
  Related Posts  to : String char count
 Return words count in a string     -  
 convert char*(number) to required unsigned char*     -  
 Set Implode char     -  
 File read by char     -  
 range of the char type     -  
 Draw char with color in php     -  
 casting to char + end of file     -  
 SQL COUNT Command     -  
 Unique Row Count Across Columns     -  
 count elements in a vector     -  

Topic Tags

PHP Strings