Home > Backend Development > PHP Tutorial > php gets the number of words iconv_strlen in mixed English and Chinese

php gets the number of words iconv_strlen in mixed English and Chinese

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-08-08 09:28:13
Original
1774 people have browsed it

When the encoding of our web page is utf-8, we can use this:

iconv_strlen($str,"utf-8") to get the word count of $str

For example: iconv_strlen("Hello hehe","utf-8") //6

The above introduces how to obtain iconv_strlen, the number of words mixed in English and Chinese, in PHP, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
utf
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Problems React encounters when using utf-8
From 1970-01-01 08:00:00
0
0
0
How to create utf-8 files in python?
From 1970-01-01 08:00:00
0
0
0
Always use UTF-8 encoding
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template