请问PHP中怎么处理UTF-8字符串啊
比如我用
<?php
Header("Content-type: text/html; charset=utf-8");
if (escapeshellarg("烦烦烦") != ("\"烦烦烦\"")) {
echo escapeshellarg("烦烦烦"). '!='. "\"烦烦烦\"";
}
?>
结果页面上就显示
"烦烦�"!="烦烦烦"
escapeshellarg似乎是把最后一字节抛弃了,这个问题怎么解决?
比如我用
<?php
Header("Content-type: text/html; charset=utf-8");
if (escapeshellarg("烦烦烦") != ("\"烦烦烦\"")) {
echo escapeshellarg("烦烦烦"). '!='. "\"烦烦烦\"";
}
?>
结果页面上就显示
"烦烦�"!="烦烦烦"
escapeshellarg似乎是把最后一字节抛弃了,这个问题怎么解决?
setlocale(LC_CTYPE, "en_US.UTF-8");
echo 'setlocale fail';
}
显示setlocale失败