View Single Post
Newbie Member
16Feb2007,19:52  
01soft's Avatar
try visit this code
from http://www.reconn.us/count_words.html
Code:
function adv_count_words($str) 
{
  $words = 0;
  $str = eregi_replace(" +", " ", $str);
  $array = explode(" ", $str);
  for($i=0;$i < count($array);$i++)
  {
    if (eregi("[0-9A-Za-zÀ-ÖØ-öø-ÿ]", $array[$i])) 
      $words++;
  }
  return $words;
}

Last edited by shabbir; 16Feb2007 at 22:08.. Reason: Code formatting.