Most of the functions circulating on the network are not able to take statistics correctly or correctly intercept Chinese and English mixed content.
Most of the functions circulating on the network are not able to take statistics correctly or correctly intercept Chinese and English mixed content.
In fact, there are already function implementations, but I did not go through the manual and did not pay attention to them.
Chinese and English mixed string statistics:
Int iconv_strlen (string $ str [, string $ charset = ini_set ("iconv. internal_encoding")])
$ S = "Chinese English ";
Echo iconv_strlen ($ s, 'utf-8'); // out: 9
?>
Intercept between Chinese and English strings:
String iconv_substr (string $ str, int $ offset [, int $ length = 0 [, string $ charset = ini_set ("iconv. internal_encoding")]
$ S = "Chinese English ";
Echo iconv_substr ($ s, 'utf-8'); // out: Chinese En
?>