Supporting special characters with str_word_count()

前端 未结 4 839
醉梦人生
醉梦人生 2021-02-20 06:36

The str_word_count() function returns an array that holds all words in a string. It works great, except when using special characters. In this case, the php script receives the

4条回答
  •  长发绾君心
    2021-02-20 07:01

    for German language use this :

    str_word_count($file, 1, 'ÄäÖöÜüß');
    

    for all other languages - just to replace the special characters with yours (French, Polish etc...)

提交回复
热议问题