mb_regex_encoding
(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)
mb_regex_encoding — Set/Get character encoding for multibyte regex
说明
Set/Get character encoding for a multibyte regex.
返回值
If encoding is set, then
成功时返回 true, 或者在失败时返回 false。
In this case, the internal character encoding is NOT changed.
If encoding is omitted, then
the current character encoding name for a multibyte regex is returned.
错误/异常
从 PHP 8.0.0 起,如果 encoding 是无效编码,
则会抛出 ValueError。
在 PHP 8.0.0 之前,会发出 E_WARNING。
更新日志
| 版本 | 说明 |
|---|---|
| 8.0.0 |
现在 encoding 可以为 null。
|
| 8.0.0 |
现在,如果 encoding 是无效编码,
会抛出 ValueError。
以前会发出 E_WARNING 并返回 false。
|
来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。
