mb_encoding_aliases 是一个 PHP 函数,它返回一个数组,包含了指定编码的别名
▥php
𝄐 0
php mb_substr,php mbstring,php mb_convert_encoding,php mb_string,php mb_convert,php mb_str
mb_encoding_aliases 是一个 PHP 函数,它返回一个数组,包含了指定编码的别名。mb_encoding_aliases 函数可以用来获取不同编码之间的相应别名,以便在编码转换时使用。以下是一个例子:
php
<?php
$aliases = mb_encoding_aliases("UTF-8");
print_r($aliases);
?>
上述例子中,mb_encoding_aliases 函数传入 "UTF-8" 作为参数,它将返回 UTF-8 编码的所有别名的数组。运行上述代码,你将会得到类似以下输出:
Array
(
[0] => utf8
[1] => ucs-4
[2] => ucs-4-internal
[3] => ucs-4le
[4] => ucs-4be
[5] => utf-32
[6] => utf-32-internal
[7] => utf-32le
[8] => utf-32be
[9] => utf-16
[10] => utf-16-internal
[11] => utf-16le
[12] => utf-16be
[13] => utf-7
[14] => utf7
[15] => ucs-2
[16] => ucs-2-internal
[17] => ucs-2le
[18] => ucs-2be
[19] => cp936
[20] => cp936ext
[21] => cp54936
[22] => ibm866
[23] => 866
[24] => cp866
...
)
上面的输出显示了 UTF-8 编码的所有别名。你可以根据自己的需求替换 "UTF-8" 参数,并使用该函数获取不同编码的别名。
mb_encoding_aliases 是一个 PHP 函数,它返回一个数组,包含了指定编码的别名。mb_encoding_aliases 函数可以用来获取不同编码之间的相应别名,以便在编码转换时使用。以下是一个例子:
php
<?php
$aliases = mb_encoding_aliases("UTF-8");
print_r($aliases);
?>
上述例子中,mb_encoding_aliases 函数传入 "UTF-8" 作为参数,它将返回 UTF-8 编码的所有别名的数组。运行上述代码,你将会得到类似以下输出:
Array
(
[0] => utf8
[1] => ucs-4
[2] => ucs-4-internal
[3] => ucs-4le
[4] => ucs-4be
[5] => utf-32
[6] => utf-32-internal
[7] => utf-32le
[8] => utf-32be
[9] => utf-16
[10] => utf-16-internal
[11] => utf-16le
[12] => utf-16be
[13] => utf-7
[14] => utf7
[15] => ucs-2
[16] => ucs-2-internal
[17] => ucs-2le
[18] => ucs-2be
[19] => cp936
[20] => cp936ext
[21] => cp54936
[22] => ibm866
[23] => 866
[24] => cp866
...
)
上面的输出显示了 UTF-8 编码的所有别名。你可以根据自己的需求替换 "UTF-8" 参数,并使用该函数获取不同编码的别名。
本文地址:
/show-280469.html
版权声明:除非特别标注原创,其它均来自互联网,转载时请以链接形式注明文章出处。