mb_regex_encoding
Set/get character encoding for multibyte regular expressions
Function name: mb_regex_encoding()
Function description: mb_regex_encoding() is used to set or get the current multibyte regular expression encoding.
usage:
Get the current multibyte regular expression encoding: string mb_regex_encoding(void)
Example:
$encoding = mb_regex_encoding(); echo "当前的多字节正则表达式编码是:".$encoding;
Set the current multibyte regular expression encoding: bool mb_regex_encoding(string $encoding)
Parameters: $encoding - The encoding name to be set, such as "UTF-8".
Example:
$encoding = "UTF-8"; $result = mb_regex_encoding($encoding); if ($result) { echo "多字节正则表达式编码已设置为:".$encoding; } else { echo "设置多字节正则表达式编码失败!"; }
Notes:
Applicable version: PHP 4.2.0 and above.