Home > php教程 > php手册 > body text

使php支持mbstring库

WBOY
Release: 2016-06-13 11:32:03
Original
885 people have browsed it

    2.  调用mb_internal_encoding(”GBK”)  >


  •  ?   
    • str = ‘我是一串比较长的中文-www.jefflei.com’;     color="#ff0000">  class="attribute">

    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







    source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Recommendations
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template