时间:2021-07-01 10:21:17 帮助过:31人阅读
2. 调用mb_internal_encoding(”GBK”)
echo “mb_substr:” . mb_substr($str, 0, 6, ‘utf-8′);
“;
?>
输出如下:
mb_substr:我是一串比较
mb_strcut:我是
(1)编译时使用–enable-mbstring
(2)修改/usr/local/lib/php.inc
default_charset = “zh-cn”
mbstring.language = zh-cn
mbstring.internal_encoding =zh-cn
php_mbstring.dll 文件。然后编辑php.ini文件:
extension=php_mbstring.dll
输出处理程序设为mbstring对应。 ;output_handler = output_handler = "mb_output_handler"
default_charset = "UTF-8"
mbstring.language = Chinese
mbstring.internal_encoding = UTF-8
mbstring.http_input = auto
输出文字编码设为UTF-8。 ;mbstring.http_output = SJIS mbstring.http_output = UTF-8
mbstring.encoding_translation = On
http://www.bkjia.com/PHPjc/440115.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/440115.htmlTechArticlephp_mbstring.dll 文件。然后编辑 php.ini 文件: extension=php_mbstring.dll output_handler = "mb_output_handler" default_charset = "UTF-8" mbstring.language = Chinese mbstr...