我想计算像Microsoft Word这样的文字中的字符。
<p><b>Lorem Ipsum</b> is simply dummy text of the printing and typesetting industry.Tom's farm. 12th century.</p>
12th - &gt; 'th'是一个特殊字符,数字为12。
我如何在 PHP ?
中执行此操作答案 0 :(得分:0)
import android.util.Log;
public class Utils {
public static void gkTestMethod(){
Log.v("Log","Log");
}
}
如果存在Unicode字符,strlen可能会将其视为两个字符。那么你应该看看mb_strlen。
答案 1 :(得分:0)
我的解决方案是;
$content = 'Some Text...';
$trim = strip_tags($content);
$trim=str_replace([" ","\n","\t","–","’","'","""," "], '', $trim);
$totalCharacter = strlen(utf8_decode($trim));