当前位置: 首页 > 网络学院 > 服务端脚本教程 > PHP > get_html_translation_table()
The get_html_translation_table() function returns the translation table used by the htmlentities() and htmlspecialchars() functions.
get_html_translation_table()函数的作用是:返回htmlspecialchars()函数和htmlentities()函数的转换表。
get_html_translation_table(function,quotestyle) |
Parameter参数 | Description描述 |
---|---|
function | Optional. Specifies which translation table to return. Default is HTML_SPECIALCHARS. 可选参数。指定返回那个翻译平台 Possible values:
|
quotestyle | Optional. Defines how to encode single and double quotes. Default is ENT_COMPAT 可选参数。定义如何对单引号和双引号进行编码。默认值是ENT_COMPAT。 Possible values:
|
Tip: Some characters can be encoded several ways. The get_html_translation_table() function returns the most common encoding.
提示:部分字符可以通过不同的方式进行编码。get_html_translation_table()函数返回了最通常使用的编码形式。
In this example we will show both translation tables.:
在下面这个案例中,我们将展示两个转换平台:
<?php print_r (get_html_translation_table()); echo "<br />"; print_r (get_html_translation_table(HTML_ENTITIES)); ?> |
The output of the code above will be:
上述代码将输出下面的结果:
Array ( ["] => " [<] => < [>] => > [&] => & ) Array ( [ ] => [¡] => ¡ [¢] => ¢ [£] => £ [¤] => ¤ [¥] => ¥ [¦] => ¦ [§] => § [¨] => ¨ [©] => © [ª] => ª [«] => « [¬] => ¬ [] => [®] => ® [¯] => ¯ [°] => ° [±] => ± [²] => ² [³] => ³ [´] => ´ [µ] => µ [¶] => ¶ [·] => · [¸] => ¸ [¹] => ¹ [º] => º [»] => » [¼] => ¼ [½] => ½ [¾] => ¾ [¿] => ¿ [À] => À [Á] => Á [Â] => Â [Ã] => Ã [Ä] => Ä [Å] => Å [Æ] => Æ [Ç] => Ç [È] => È [É] => É [Ê] => Ê [Ë] => Ë [Ì] => Ì [Í] => Í [Î] => Î [Ï] => Ï [Ð] => Ð [Ñ] => Ñ [Ò] => Ò [Ó] => Ó [Ô] => Ô [Õ] => Õ [Ö] => Ö [×] => × [Ø] => Ø [Ù] => Ù [Ú] => Ú [Û] => Û [Ü] => Ü [Ý] => Ý [Þ] => Þ [ß] => ß [à] => à [á] => á [â] => â [ã] => ã [ä] => ä [å] => å [æ] => æ [ç] => ç [è] => è [é] => é [ê] => ê [ë] => ë [ì] => ì [í] => í [î] => î [ï] => ï [ð] => ð [ñ] => ñ [ò] => ò [ó] => ó [ô] => ô [õ] => õ [ö] => ö [÷] => ÷ [ø] => ø [ù] => ù [ú] => ú [û] => û [ü] => ü [ý] => ý [þ] => þ [ÿ] => ÿ ["] => " [<] => < [>] => > [&] => & ) |