str_word_count.php : str_word_count « String « PHP






str_word_count.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);
   echo "Total words in summary: $words";
?>
  
  








Related examples in the same category

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