str_word_count-2.php : str_word_count « String « PHP






str_word_count-2.php

 
<?php
$summary = <<< summary
this is a test. this is a test. this is a test. this is a test. this is a test. this is a test.
this is a test. this is a test. this is a test. this is a test. this is a test. this is a test.
this is a test. this is a test. this is a test. this is a test. this is a test. this is a test.
summary;
   $words = str_word_count($summary,2);
   $frequency = array_count_values($words);
   print_r($frequency);
?>
  
  








Related examples in the same category

1.str_word_count.php
2.mixed str_word_count ( string str [, int count_type [, string char_list]] ) returns the number of words in a string