Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

on page
it's stated that: "For the purpose of this function, 'word' is defined as a
locale dependent string"

But it does not seem to work, the output of the following script is
string(10) "fr_FR.utf8" Array ( [0] => hello [1] => conomie [2] => bla )

I think, that "économie" should be recognized as word.

Here is the test-script:

echo '<html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
var_dump(setlocale(LC_ALL, 'fr_FR.utf8'));
print_r(str_word_count('hello économie bla, 1));
echo '</body></html>';

Could someone help please?
My PHP version is 5.1.2.

Greetings, Peter

email: pmrb at

Re: str_word_count

*** Peter Münster escribió/wrote (Fri, 25 Aug 2006 10:04:32 +0200):
Quoted text here. Click to load it

Where's the output for var_dump(setlocale(LC_ALL, 'fr_FR.utf8'))? Locales
are system dependent and I'd bet it's printing FALSE in order to say
fr_FR.utf8 is not available.

Quoted text here. Click to load it

-+ - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web:
+- Mi web de humor con rayos UVA:

Re: str_word_count and locale (was: str_word_count)

On Fri, 25 Aug 2006, Alvaro G. Vicario wrote:

Quoted text here. Click to load it

Hello Alvaro,

the output of "var_dump(setlocale(LC_ALL, 'fr_FR.utf8')) is:
string(10) "fr_FR.utf8"

Do you have other ideas, what's going wrong here?

Cheers, Peter

email: pmrb at

Site Timeline