function str_word_count_utf8($str) {
return count(preg_split('~[^p{L}p{N}']+~u',$str));
}
As it is quoted
If the pattern contains utf-8, utf8_encode() the pattern,
as it is expected to be valid utf-8 (using the u modifier).
Author: Nabin Nepal (Starx)
Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+
View all posts by Nabin Nepal (Starx)
Please fill the form - I will response as fast as I can!