溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

怎么在PHP中使用 get_html_translation_table()函數(shù)

發(fā)布時間:2021-01-04 14:46:23 來源:億速云 閱讀:138 作者:Leah 欄目:開發(fā)技術(shù)

怎么在PHP中使用 get_html_translation_table()函數(shù)?針對這個問題,這篇文章詳細介紹了相對應(yīng)的分析和解答,希望可以幫助更多想解決這個問題的小伙伴找到更簡單易行的方法。

PHP get_html_translation_table() 函數(shù)

實例

輸出 htmlspecialchars 函數(shù)使用的翻譯表:

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

定義和用法

get_html_translation_table()函數(shù)返回htmlentities()htmlspecialchars()函數(shù)使用的翻譯表。

提示:一些字符可以按照若干種方式進行編碼。get_html_translation_table() 函數(shù)返回最普通的編碼。

語法

get_html_translation_table( _function,flags,character-set_ )

怎么在PHP中使用 get_html_translation_table()函數(shù)

怎么在PHP中使用 get_html_translation_table()函數(shù)

實例

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)); 
?>

顯示字符及其對應(yīng)的實體名稱:

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; 
)

關(guān)于怎么在PHP中使用 get_html_translation_table()函數(shù)問題的解答就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,如果你還有很多疑惑沒有解開,可以關(guān)注億速云行業(yè)資訊頻道了解更多相關(guān)知識。

向AI問一下細節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI