Count words like Microsoft Word does
Posted
by Maarten
on Stack Overflow
See other posts from Stack Overflow
or by Maarten
Published on 2010-01-27T09:54:51Z
Indexed on
2010/05/03
16:48 UTC
Read the original article
Hit count: 299
php
|JavaScript
I need to count words in a string using PHP or Javascript (preferably PHP). The problem is that the counting needs to be the same as it works in Microsoft Word, because that is where the people assemble their original texts in so that is their reference frame. PHP has a word counting function (http://php.net/manual/en/function.str-word-count.php) but that is not 100% the same as far as I know.
Any pointers?
© Stack Overflow or respective owner