Rumah >pembangunan bahagian belakang >tutorial php >使php支持mbstring库_PHP教程
2. 调用mb_internal_encoding(”GBK”) >
echo “mb_substr:” . mb_substr($str, 0, 6, ‘utf-8′);
“;
?> color="#006699">
class="alt"> class="alt"> class="alt"> class="alt"> class="dp-xml">
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
output_handler = "mb_output_handler"
default_charset = "UTF-8"
mbstring.language = Chinese
mbstring.internal_encoding = UTF-8
mbstring.http_input = auto
mbstring.http_output = UTF-8
mbstring.encoding_translation = On