Why use multibyte string functions in PHP?

后端 未结 6 1782
情话喂你
情话喂你 2020-12-16 18:49

At the moment, I don\'t understand why it is really important to use mbstring functions in PHP when dealing with UTF-8? My locale under linux is already set

6条回答
  •  温柔的废话
    2020-12-16 19:10

    multibyte => multi + byte.

    1) It is use to work with string which is in other language(means not in English) format.

    2) Default PHP string functions only work proper with English (or releted to it) language.

    3) If you want to use strlen() or strpos() or uppercase() or strreplace() for special character,
               Suppose We need to apply string functions on "Hello".
               In chines (你好), Arabic (مرحبا), Japanese (こんにちは), Hindi ( नमस्ते), Gujarati (હેલો).
               Different language can it's own character sets

    so that mbstring introduced for communicate with various languages like (chines,Japanese etc).

提交回复
热议问题