【发布时间】:2016-01-23 09:44:10
【问题描述】:
我的子字符串函数有问题。当特殊字符是生成的子字符串的最后一个字符时(并且只有那个字符!!!),这个字符被表示为一个带有问号的图标。
我的代码来了:
$string = 'This is a string and when a German word with a special char like "Tür" appears and the special char ü is the last character of the substring it gets represented as an icon with question mark';
echo substr($string,0,102). "...";
结果:
这是一个字符串,当一个带有特殊字符的德语单词,如“Tür” 出现和特殊字符... ...
我怎样才能避免这种情况?
【问题讨论】: