Quote:
Originally Posted by sabret00the
how do you work it out, i thought it would just be
PHP Code:
$wordcount = str_word_count($text);
$charcount = array_sum(count_chars($text));
but for whatever reason the data isn't quite right, is there another way to work this out?
|
Define "quite right." A word can be defined many ways.
count_chars() groups the number of times specific characters occur. If you just want a string's length, use strlen() instead.