温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

怎么在PHP中使用 get_html_translation_table()函数

发布时间:2021-01-04 14:46:23 来源:亿速云 阅读:139 作者:Leah 栏目:开发技术

怎么在PHP中使用 get_html_translation_table()函数?针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。

PHP get_html_translation_table() 函数

实例

输出 htmlspecialchars 函数使用的翻译表:

<?php 
print_r (get_html_translation_table()); // HTML_SPECIALCHARS is default. 
?>

定义和用法

get_html_translation_table()函数返回htmlentities()htmlspecialchars()函数使用的翻译表。

提示:一些字符可以按照若干种方式进行编码。get_html_translation_table() 函数返回最普通的编码。

语法

get_html_translation_table( _function,flags,character-set_ )

怎么在PHP中使用 get_html_translation_table()函数

怎么在PHP中使用 get_html_translation_table()函数

实例

HTML_SPECIALCHARS 的翻译表:

<?php 
print_r (get_html_translation_table(HTML_SPECIALCHARS)); 
?>
Displaying character and entity name:
Array 
( 
["] => &quot; 
[&] => &amp; 
[<] => &lt; 
[>] => &gt; 
)

实例 2

HTML_ENTITIES 的翻译表:

<?php 
print_r (get_html_translation_table(HTML_ENTITIES)); 
?>

显示字符及其对应的实体名称:

Array 

["] => &quot; 
[&] => &amp; 
[<] => &lt; 
[>] => &gt; 
[ ] => &nbsp; 
[&iexcl;] => &iexcl; 
[&cent;] => &cent; 
[&pound;] => &pound; 
[¤] => &curren; 
[&yen;] => &yen; 
[&brvbar;] => &brvbar; 
[§] => &sect; 
[¨] => &uml; 
[&copy;] => &copy; 
[&ordf;] => &ordf; 
[&laquo;] => &laquo; 
[&not;] => &not; 
[&shy;] => &shy; 
[&reg;] => &reg; 
[&macr;] => &macr; 
[°] => &deg; 
[±] => &plusmn; 
[&sup2;] => &sup2; 
[&sup3;] => &sup3; 
[&acute;] => &acute; 
[&micro;] => &micro; 
[&para;] => &para; 
[·] => &middot; 
[&cedil;] => &cedil; 
[&sup1;] => &sup1; 
[&ordm;] => &ordm; 
[&raquo;] => &raquo; 
[&frac14;] => &frac14; 
[&frac12;] => &frac12; 
[&frac34;] => &frac34; 
[&iquest;] => &iquest; 
[&Agrave;] => &Agrave; 
[&Aacute;] => &Aacute; 
[&Acirc;] => &Acirc; 
[&Atilde;] => &Atilde; 
[&Auml;] => &Auml; 
[&Aring;] => &Aring; 
[&AElig;] => &AElig; 
[&Ccedil;] => &Ccedil; 
[&Egrave;] => &Egrave; 
[&Eacute;] => &Eacute; 
[&Ecirc;] => &Ecirc; 
[&Euml;] => &Euml; 
[&Igrave;] => &Igrave; 
[&Iacute;] => &Iacute; 
[&Icirc;] => &Icirc; 
[&Iuml;] => &Iuml; 
[&ETH;] => &ETH; 
[&Ntilde;] => &Ntilde; 
[&Ograve;] => &Ograve; 
[&Oacute;] => &Oacute; 
[&Ocirc;] => &Ocirc; 
[&Otilde;] => &Otilde; 
[&Ouml;] => &Ouml; 
[×] => &times; 
[&Oslash;] => &Oslash; 
[&Ugrave;] => &Ugrave; 
[&Uacute;] => &Uacute; 
[&Ucirc;] => &Ucirc; 
[&Uuml;] => &Uuml; 
[&Yacute;] => &Yacute; 
[&THORN;] => &THORN; 
[&szlig;] => &szlig; 
[à] => &agrave; 
[á] => &aacute; 
[&acirc;] => &acirc; 
[&atilde;] => &atilde; 
[&auml;] => &auml; 
[&aring;] => &aring; 
[&aelig;] => &aelig; 
[&ccedil;] => &ccedil; 
[è] => &egrave; 
[é] => &eacute; 
[ê] => &ecirc; 
[&euml;] => &euml; 
[ì] => &igrave; 
[í] => &iacute; 
[&icirc;] => &icirc; 
[&iuml;] => &iuml; 
[&eth;] => &eth; 
[&ntilde;] => &ntilde; 
[ò] => &ograve; 
[ó] => &oacute; 
[&ocirc;] => &ocirc; 
[&otilde;] => &otilde; 
[&ouml;] => &ouml; 
[÷] => &divide; 
[&oslash;] => &oslash; 
[ù] => &ugrave; 
[ú] => &uacute; 
[&ucirc;] => &ucirc; 
[ü] => &uuml; 
[&yacute;] => &yacute; 
[&thorn;] => &thorn; 
[&yuml;] => &yuml; 
[Œ] => &OElig; 
[œ] => &oelig; 
[Š] => &Scaron; 
[š] => &scaron; 
[Ÿ] => &Yuml; 
[ƒ] => &fnof; 
[ˆ] => &circ; 
[˜] => &tilde; 
[Α] => &Alpha; 
[Β] => &Beta; 
[Γ] => &Gamma; 
[Δ] => &Delta; 
[Ε] => &Epsilon; 
[Ζ] => &Zeta; 
[Η] => &Eta; 
[Θ] => &Theta; 
[Ι] => &Iota; 
[Κ] => &Kappa; 
[Λ] => &Lambda; 
[Μ] => &Mu; 
[Ν] => &Nu; 
[Ξ] => &Xi; 
[Ο] => &Omicron; 
[Π] => &Pi; 
[Ρ] => &Rho; 
[Σ] => &Sigma; 
[Τ] => &Tau; 
[Υ] => &Upsilon; 
[Φ] => &Phi; 
[Χ] => &Chi; 
[Ψ] => &Psi; 
[Ω] => &Omega; 
[α] => &alpha; 
[β] => &beta; 
[γ] => &gamma; 
[δ] => &delta; 
[ε] => &epsilon; 
[ζ] => &zeta; 
[η] => &eta; 
[θ] => &theta; 
[ι] => &iota; 
[κ] => &kappa; 
[λ] => &lambda; 
[μ] => &mu; 
[ν] => &nu; 
[ξ] => &xi; 
[ο] => &omicron; 
[π] => &pi; 
[ρ] => &rho; 
[ς] => &sigmaf; 
[σ] => &sigma; 
[τ] => &tau; 
[υ] => &upsilon; 
[φ] => &phi; 
[χ] => &chi; 
[ψ] => &psi; 
[ω] => &omega; 
[ϑ] => &thetasym; 
[ϒ] => &upsih; 
[ϖ] => &piv; 
[ ] => &ensp; 
[ ] => &emsp; 
[ ] => &thinsp; 
[‌] => &zwnj; 
[‍] => &zwj; 
[‎] => &lrm; 
[‏] => &rlm; 
[–] => &ndash; 
[—] => &mdash; 
['] => &lsquo; 
['] => &rsquo; 
[‚] => &sbquo; 
["] => &ldquo; 
["] => &rdquo; 
[„] => &bdquo; 
[†] => &dagger; 
[‡] => &Dagger; 
[•] => &bull; 
[…] => &hellip; 
[‰] => &permil; 
[′] => &prime; 
[″] => &Prime; 
[‹] => &lsaquo; 
[›] => &rsaquo; 
[‾] => &oline; 
[⁄] => &frasl; 
[?] => &euro; 
[ℑ] => &image; 
[℘] => &weierp; 
[ℜ] => &real; 
[™] => &trade; 
[ℵ] => &alefsym; 
[←] => &larr; 
[↑] => &uarr; 
[→] => &rarr; 
[↓] => &darr; 
[↔] => &harr; 
[↵] => &crarr; 
[⇐] => &lArr; 
[⇑] => &uArr; 
[⇒] => &rArr; 
[⇓] => &dArr; 
[⇔] => &hArr; 
[∀] => &forall; 
[∂] => &part; 
[∃] => &exist; 
[∅] => &empty; 
[∇] => &nabla; 
[∈] => &isin; 
[∉] => &notin; 
[∋] => &ni; 
[∏] => &prod; 
[∑] => &sum; 
[−] => &minus; 
[∗] => &lowast; 
[√] => &radic; 
[∝] => &prop; 
[∞] => &infin; 
[∠] => &ang; 
[∧] => &and; 
[∨] => &or; 
[∩] => &cap; 
[∪] => &cup; 
[∫] => &int; 
[∴] => &there4; 
[∼] => &sim; 
[≅] => &cong; 
[≈] => &asymp; 
[≠] => &ne; 
[≡] => &equiv; 
[≤] => &le; 
[≥] => &ge; 
[⊂] => &sub; 
[⊃] => &sup; 
[⊄] => &nsub; 
[⊆] => &sube; 
[⊇] => &supe; 
[⊕] => &oplus; 
[⊗] => &otimes; 
[⊥] => &perp; 
[⋅] => &sdot; 
[⌈] => &lceil; 
[⌉] => &rceil; 
[⌊] => &lfloor; 
[⌋] => &rfloor; 
[〈] => &lang; 
[〉] => &rang; 
[◊] => &loz; 
[♠] => &spades; 
[♣] => &clubs; 
[♥] => &hearts; 
[♦] => &diams; 
)

关于怎么在PHP中使用 get_html_translation_table()函数问题的解答就分享到这里了,希望以上内容可以对大家有一定的帮助,如果你还有很多疑惑没有解开,可以关注亿速云行业资讯频道了解更多相关知识。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI