htmlentities()与htmlspecialchars()


Answers:


343

从PHP文档获取htmlentities

此函数htmlspecialchars()在所有方面都相同,除了之外htmlentities(),所有具有HTML字符实体等效项的字符都被翻译成这些实体。

从PHP文档获取htmlspecialchars

某些字符在HTML中具有特殊意义,如果要保留其含义,则应由HTML实体表示。该函数返回一个字符串,其中包含一些转换。所做的翻译对于日常Web编程最有用。如果您需要翻译所有HTML字符实体,请htmlentities()改用。

区别在于所编码的是什么。选择是所有(实体)或“特殊”字符,例如“与”号,双引号和单引号,小于和大于(特殊字符)。

我更喜欢使用 htmlspecialchars

例如:

    echo htmlentities('<Il était une fois un être>.');
    // Output: &lt;Il &eacute;tait une fois un &ecirc;tre&gt;.
    //                ^^^^^^^^                 ^^^^^^^

    echo htmlspecialchars('<Il était une fois un être>.');
    // Output: &lt;Il était une fois un être&gt;.
    //                ^                 ^

31
感谢您的回答,但是htmlspecialchars()除了明显的区别之外,您是否愿意详细说明自己喜欢的内容?什么情况下使用会给htmlentities()您带来麻烦,而htmlspecialchars()不会呢?
MikeSchinkel

17
只是由于使用htmlentities而不是htmlspecialchars而遇到问题!如果您的网站是UTF8编码的,则特殊符号(如¡™£¢∞§¶)会变成带有问号的黑色小菱形,因为htmlentities不知道如何处理它们,而htmlspecialchars却可以。
大流士

32
@Darius您所说的没有任何意义。htmlentities并且htmlspecialchars既可以处理UTF-8,只要你指定"UTF-8"的第三个参数。
Artefacto 2012年

14
从PHP 5.4开始,UTF-8是默认的编码选项(第三个参数)。
乔纳森

7
@Darius:我们碰到了类似的事情。像我们一样,您可能正在使用5.4.0之前的PHP。因此,根据乔纳森(Jonathan)的评论,我们需要像这样明确地指定UTF-8:htmlentities($ str,ENT_QUOTES,'UTF-8');
rinogo

378

htmlspecialchars 可能用过了:

  1. 无需编码所有具有等效HTML字符的字符时。

    如果您知道页面编码与文本特殊符号匹配,那么为什么要使用htmlentitieshtmlspecialchars非常简单,生成的代码更少,可以发送给客户端。

    例如:

    echo htmlentities('<Il était une fois un être>.');
    // Output: &lt;Il &eacute;tait une fois un &ecirc;tre&gt;.
    //                ^^^^^^^^                 ^^^^^^^
    
    echo htmlspecialchars('<Il était une fois un être>.');
    // Output: &lt;Il était une fois un être&gt;.
    //                ^                 ^

    第二个较短,如果设置了ISO-8859-1字符集,则不会引起任何问题。

  2. 当不仅要通过浏览器处理数据(以避免解码HTML实体)时,

  3. 如果输出是XML(请参阅Artefacto的答案)。


4
如果您使用的PHP版本低于5.4,则htmlspecialchars($ str,ENT_QUOTES,“ UTF-8”)最好。ENT_QUOTES是编码单引号所必需的。
塔里克

97

这是用编码的htmlentities

implode( "\t", array_values( get_html_translation_table( HTML_ENTITIES ) ) )

“&<>
±£¥§»»²»»»»»»»»»ÇÇÇÈÈÈÉËËËÎËÎÓ ×××ØÜßßßææçö÷œœœ ΑΒΕΖΜΜββββαβγδδεζηθικλμνξοπρστ ωϑ ϖ – –'',“”†‡•…‰′” ‹› ⁄ ⁄€ℑ™™™←↑→↓↔↵⇑⇒⇓⇔⇔∂∈∈ ∑ ∑-∗√∝∞∠∧∧∫∫∴〜≈≠≡≤≥⊂⋅⋅⋅♥♦

这是用编码的htmlspecialchars

implode( "\t", array_values( get_html_translation_table( HTML_SPECIALCHARS ) ) )

“&<>


3
谨防!乍一看,htmlentities看起来很完整。但是,它缺少一堆真正的基本字符和通用字符(特别是如果您的客户喜欢MS的话)。智能引号(例如'或&rsquo;),破折号(例如-或&dash),商标符号(™或&trade;),以及许多其他符号会使它返回null。
Jonathan Lidbeck

9
@Jonathan这些在列表中。如果得到的结果为空,则可能是您指定的编码错误。
Artefacto

4
或者您没有指定编码,而是依靠默认值,该默认值在PHP 5.4中进行了更改,然后(可能)在PHP 5.6中进行了更改,具体取决于您的配置。直到2012年,文档甚至都不建议您指定该参数。因此,如果您没有指定可选的第三个参数,而是升级了PHP,则htmlentities首先使用ISO-8859-1,然后使用UTF-8,然后使用php.ini中的所有内容,而不会在任何问题上引发错误,但悄悄地什么也没返回。显然,这绝对不可能在某些时候导致数据丢失!
Aaa

96

因为:

  • 有时您正在编写XML数据,而不能在XML文件中使用HTML实体。
  • 因为htmlentities用代替更多字符htmlspecialchars。这是不必要的,这会使PHP脚本的效率降低,并且所产生的HTML代码的可读性降低。

htmlentities 仅当您的页面使用诸如ASCII或LATIN-1之类的编码而不是UTF-8且您正在使用与该页面不同的编码来处理数据时才需要。


19

htmlspecialchars($strText, ENT_QUOTES)当您只希望字符串是XML和HTML安全的时,应使用:

例如,编码

  • &至&amp;
  • “到”
  • <至&lt;
  • >到&gt;
  • 到&#039;

但是,如果文本中还包含Unicode字符或不常见符号的其他字符,则应使用htmlentities()来确保它们在HTML页面中正确显示。

笔记:

  • '将仅由htmlspecialchars()编码为&#039; 如果传入ENT_QUOTES选项。使用起来更安全 因为较旧版本的Internet Explorer不支持“ 实体。
  • 从技术上讲,>不必按照XML规范进行编码,但是为了符合<编码的要求,通常也对其进行编码。

2
问题是:因为我的文本是由用户提供的,所以我不知道我是否在其中包含unicode或不常见的符号。为什么在这种情况下我应该使用htmlspecialchars?
EKanadily

14

htmlspecialchars ()进行最少的编码以确保您的字符串不会被解析为HTML。htmlentities ()与以前对绝对具有编码的所有内容进行编码相比,这将使您的字符串更具可读性。



9

htmlentities —将所有适用的字符转换为HTML实体。

htmlspecialchars —将特殊字符转换为HTML实体。

翻译在以下方面执行了翻译字符:

  • “&”(与号)变为“&amp;”
  • “”(双引号)变为“”。未设置ENT_NOQUOTES时。
  • “”(单引号)变为“&#039;” (或')仅在设置ENT_QUOTES时。
  • “ <”(小于)变为“&lt;”
  • “>”(大于)变为“&gt;”

您可以检查以下代码,以获取有关什么是htmlentities和htmlspecialchars的更多信息:

https://gist.github.com/joko-wandiro/f5c935708d9c37d8940b


7

您可能要使用一些Unicode字符编码,例如UTF-8和htmlspecialchars。因为没有任何需要生成“HTML实体”为“所有[的]适用人物”(即是根据什么文件呢ヶ辆),如果它已经在你的字符集。


3

一个小例子,我需要在一个函数中索引两个客户端名称:

[1] => Altisoxxce Soluxxons S r.l.
[5] => Joxxson & Joxxson

最初$term = get_term_by('name', htmlentities($name), 'client');,我得到的术语名称仅包含“&”数组项(&),而没有带重音符号的项。但是,当我将变量设置更改为htmlspecialchars两者时,都可以运行该函数。希望这可以帮助!


3

htmlspecialchars()和htmlentities()之间的差异很小。让我们看一些例子:

html特殊字符

htmlspecialchars(string $ string) 接受多个参数,其中第一个参数是字符串,而所有其他参数(某些标志,某些编码等)是可选的。htmlspecialchars 将字符串中的特殊字符转换为HTML实体。例如,如果您 的字符串中包含 <br>,则htmlspecialchars会将其转换为&lt; b&gt; 。而诸如µ†等字符在HTML中没有特殊意义。因此,它们不会通过htmlspecialchars函数转换为HTML实体,如下面的示例所示。

echo htmlspecialchars('An example <br>'); // This will print - An example &lt; br &gt;
echo htmlspecialchars('µ †');             // This will print -  µ †

htmlentities

htmlentities(字符串$ string)htmlspecialchars非常相似, 并采用多个参数,其中第一个参数是字符串,而所有其他参数都是可选的(某些标志,某些编码等)。与htmlspecialchars不同 ,htmlentities不仅将字符串中的特殊字符转换为HTML实体, 还将所有适用的字符转换为HTML实体。

echo htmlentities('An example <br>'); // This will print - An example &lt; br &gt;
echo htmlentities('µ †');             // This will print -  &micro; &dagger; 

2
**HTML Character Entity Reference Chart at W3.org**

https://dev.w3.org/html5/html-author/charref

&Tab;
&NewLine;
!
&excl;
"
&quot; &QUOT;
#
&num;
$
&dollar;
%
&percnt;
&
&amp; &AMP;
'
&apos;
(
&lpar;
)
&rpar;
*
&ast; &midast;
+
&plus;
,
&comma;
.
&period;
/
&sol;
:
&colon;
;
&semi;
<
&lt; &LT;
=
&equals;
>
&gt; &GT;
?
&quest;
@
&commat;
[
&lsqb; &lbrack;
\
&bsol;
]
&rsqb; &rbrack;
^
&Hat;
_
&lowbar;
`
&grave; &DiacriticalGrave;
{
&lcub; &lbrace;
|
&verbar; &vert; &VerticalLine;
}
&rcub; &rbrace;

&nbsp; &NonBreakingSpace;
¡
&iexcl;
¢
&cent;
£
&pound;
¤
&curren;
¥
&yen;
¦
&brvbar;
§
&sect;
¨
&Dot; &die; &DoubleDot; &uml;
©
&copy; &COPY;
ª
&ordf;
«
&laquo;
¬
&not;
&shy;
®
&reg; &circledR; &REG;
¯
&macr; &OverBar; &strns;
°
&deg;
±
&plusmn; &pm; &PlusMinus;
²
&sup2;
³
&sup3;
´
&acute; &DiacriticalAcute;
µ
&micro;
¶
&para;
·
&middot; &centerdot; &CenterDot;
¸
&cedil; &Cedilla;
¹
&sup1;
º
&ordm;
»
&raquo;
¼
&frac14;
½
&frac12; &half;
¾
&frac34;
¿
&iquest;
À
&Agrave;
Á
&Aacute;
Â
&Acirc;
Ã
&Atilde;
Ä
&Auml;
Å
&Aring;
Æ
&AElig;
Ç
&Ccedil;
È
&Egrave;
É
&Eacute;
Ê
&Ecirc;
Ë
&Euml;
Ì
&Igrave;
Í
&Iacute;
Î
&Icirc;
Ï
&Iuml;
Ð
&ETH;
Ñ
&Ntilde;
Ò
&Ograve;
Ó
&Oacute;
Ô
&Ocirc;
Õ
&Otilde;
Ö
&Ouml;
×
&times;
Ø
&Oslash;
Ù
&Ugrave;
Ú
&Uacute;
Û
&Ucirc;
Ü
&Uuml;
Ý
&Yacute;
Þ
&THORN;
ß
&szlig;
à
&agrave;
á
&aacute;
â
&acirc;
ã
&atilde;
ä
&auml;
å
&aring;
æ
&aelig;
ç
&ccedil;
è
&egrave;
é
&eacute;
ê
&ecirc;
ë
&euml;
ì
&igrave;
í
&iacute;
î
&icirc;
ï
&iuml;
ð
&eth;
ñ
&ntilde;
ò
&ograve;
ó
&oacute;
ô
&ocirc;
õ
&otilde;
ö
&ouml;
÷
&divide; &div;
ø
&oslash;
ù
&ugrave;
ú
&uacute;
û
&ucirc;
ü
&uuml;
ý
&yacute;
þ
&thorn;
ÿ
&yuml;
Ā
&Amacr;
ā
&amacr;
Ă
&Abreve;
ă
&abreve;
Ą
&Aogon;
ą
&aogon;
Ć
&Cacute;
ć
&cacute;
Ĉ
&Ccirc;
ĉ
&cc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ubreve;
ŭ
&ubreve;
Ů
&Uring;
ů
&uring;
Ű
&Udblac;
ű
&udblac;
Ų
&Uogon;
ų
&uogon;
Ŵ
&Wcirc;
ŵ
&wcirc;
Ŷ
&Ycirc;
ŷ
&ycirc;
Ÿ
&Yuml;
Ź
&Zacute;
ź
&zacute;
Ż
&Zdot;
ż
&zdot;
Ž
&Zcaron;
ž
&zcaron;
ƒ
&fnof;
Ƶ
&imped;
ǵ
&gacute;
ȷ
&jmath;
ˆ
&circ;
ˇ
&caron; &Hacek;
˘
&breve; &Breve;
˙
&dot; &DiacriticalDot;
˚
&ring;
˛
&ogon;
˜
&tilde; &DiacriticalTilde;
˝
&dblac; &DiacriticalDoubleAcute;
̑
&DownBreve;
̲
&UnderBar;
Α
&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;
ε
&epsiv; &varepsilon; &epsilon;
ζ
&zeta;
η
&eta;
θ
&theta;
ι
&iota;
κ
&kappa;
λ
&lambda;
μ
&mu;
ν
&nu;
ξ
&xi;
ο
&omicron;
π
&pi;
ρ
&rho;
ς
&sigmav; &varsigma; &sigmaf;
σ
&sigma;
τ
&tau;
υ
&upsi; &upsilon;
φ
&phi; &phiv; &varphi;
χ
&chi;
ψ
&psi;
ω
&omega;
ϑ
&thetav; &vartheta; &thetasym;
ϒ
&Upsi; &upsih;
ϕ
&straightphi;
ϖ
&piv; &varpi;
Ϝ
&Gammad;
ϝ
&gammad; &digamma;
ϰ
&kappav; &varkappa;
ϱ
&rhov; &varrho;
ϵ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pace; &NegativeVeryThinSpace; &NegativeThinSpace; &NegativeMediumSpace; &NegativeThickSpace;
‌
&zwnj;
‍
&zwj;
‎
&lrm;
‏
&rlm;
‐
&hyphen; &dash;
–
&ndash;
—
&mdash;
―
&horbar;
‖
&Verbar; &Vert;
‘
&lsquo; &OpenCurlyQuote;
’
&rsquo; &rsquor; &CloseCurlyQuote;
‚
&lsquor; &sbquo;
“
&ldquo; &OpenCurlyDoubleQuote;
”
&rdquo; &rdquor; &CloseCurlyDoubleQuote;
„
&ldquor; &bdquo;
†
&dagger;
‡
&Dagger; &ddagger;
•
&bull; &bullet;
‥
&nldr;
…
&hellip; &mldr;
‰
&permil;
‱
&pertenk;
′
&prime;
″
&Prime;
‴
&tprime;
‵
&bprime; &backprime;
‹
&lsaquo;
›
&rsaquo;
‾
&oline;
⁁
&caret;
⁃
&hybull;
⁄
&frasl;
⁏
&bsemi;
⁗
&qprime;
 
&MediumSpace;
⁠
&NoBreak;
⁡
&ApplyFunction; &af;
⁢
&InvisibleTimes; &it;
⁣
&InvisibleComma; &ic;
€
&euro;
⃛
&tdot; &TripleDot;
⃜
&DotDot;
ℂ
&Copf; &complexes;
℅
&incare;
ℊ
&gscr;
ℋ
&hamilt; &HilbertSpace; &Hscr;
ℌ
&Hfr; &Poincareplane;
ℍ
&quaternions; &Hopf;
ℎ
&planckh;
ℏ
&planck; &hbar; &plankv; &hslash;
ℐ
&Iscr; &imagline;
ℑ
&image; &Im; &imagpart; &Ifr;
ℒ
&Lscr; &lagran; &Laplacetrf;
ℓ
&ell;
ℕ
&Nopf; &naturals;
№
&numero;
℗
&copysr;
℘
&weierp; &wp;
ℙ
&Popf; &primes;
ℚ
&rationals; &Qopf;
ℛ
&Rscr; &realine;
ℜ
&real; &Re; &realpart; &Rfr;
ℝ
&reals; &Ropf;
℞
&rx;
™
&trade; &TRADE;
ℤ
&integers; &Zopf;
Ω
&ohm;
℧
&mho;
ℨ
&Zfr; &zeetrf;
℩
&iiota;
Å
&angst;
ℬ
&bernou; &Bernoullis; &Bscr;
ℭ
&Cfr; &Cayleys;
ℯ
&escr;
ℰ
&Escr; &expectation;
ℱ
&Fscr; &Fouriertrf;
ℳ
&phmmat; &Mellintrf; &Mscr;
ℴ
&order; &orderof; &oscr;
ℵ
&alefsym; &aleph;
ℶ
&beth;
ℷ
&gimel;
ℸ
&daleth;
ⅅ
&CapitalDifferentialD; &DD;
ⅆ
&DifferentialD; &dd;
ⅇ
&ExponentialE; &exponentiale; &ee;
ⅈ
&ImaginaryI; &ii;
⅓
&frac13;
⅔
&frac23;
⅕
&frac15;
⅖
&frac25;
⅗
&frac35;
⅘
&frac45;
⅙
&frac16;
⅚
&frac56;
⅛
&frac18;
⅜
&frac38;
⅝
&frac58;
⅞
&frac78;
←
&larr; &leftarrow; &LeftArrow; &slarr; &ShortLeftArrow;
↑
&uarr; &uparrow; &UpArrow; &ShortUpArrow;
→
&rarr; &rightarrow; &RightArrow; &srarr; &ShortRightArrow;
↓
&darr; &downarrow; &DownArrow; &ShortDownArrow;
↔
&harr; &leftrightarrow; &LeftRightArrow;
↕
&varr; &updownarrow; &UpDownArrow;
↖
&nwarr; &UpperLeftArrow; &nwarrow;
↗
&nearr; &UpperRightArrow; &nearrow;
↘
&searr; &searrow; &LowerRightArrow;
↙
&swarr; &swarrow; &LowerLeftArrow;
↚
&nlarr; &nleftarrow;
↛
&nrarr; &nrightarrow;
↝
&rarrw; &rightsquigarrow;
↞
&Larr; &twoheadleftarrow;
↟
&Uarr;
↠
&Rarr; &twoheadrightarrow;
↡
&Darr;
↢
&larrtl; &leftarrowtail;
↣
&rarrtl; &rightarrowtail;
↤
&LeftTeeArrow; &mapstoleft;
↥
&UpTeeArrow; &mapstoup;
↦
&map; &RightTeeArrow; &mapsto;
↧
&DownTeeArrow; &mapstodown;
↩
&larrhk; &hookleftarrow;
↪
&rarrhk; &hookrightarrow;
↫
&larrlp; &looparrowleft;
↬
&rarrlp; &looparrowright;
↭
&harrw; &leftrightsquigarrow;
↮
&nharr; &nleftrightarrow;
↰
&lsh; &Lsh;
↱
&rsh; &Rsh;
↲
&ldsh;
↳
&rdsh;
↵
&crarr;
↶
&cularr; &curvearrowleft;
↷
&curarr; &curvearrowright;
↺
&olarr; &circlearrowleft;
↻
&orarr; &circlearrowright;
↼
&lharu; &LeftVector; &leftharpoonup;
↽
&lhard; &leftharpoondown; &DownLeftVector;
↾
&uharr; &upharpoonright; &RightUpVector;
↿
&uharl; &upharpoonleft; &LeftUpVector;
⇀
&rharu; &RightVector; &rightharpoonup;
⇁
&rhard; &rightharpoondown; &DownRightVector;
⇂
&dharr; &RightDownVector; &downharpoonright;
⇃
&dharl; &LeftDownVector; &downharpoonleft;
⇄
&rlarr; &rightleftarrows; &RightArrowLeftArrow;
⇅
&udarr; &UpArrowDownArrow;
⇆
&lrarr; &leftrightarrows; &LeftArrowRightArrow;
⇇
&llarr; &leftleftarrows;
⇈
&uuarr; &upuparrows;
⇉
&rrarr; &rightrightarrows;
⇊
&ddarr; &downdownarrows;
⇋
&lrhar; &ReverseEquilibrium; &leftrightharpoons;
⇌
&rlhar; &rightleftharpoons; &Equilibrium;
⇍
&nlArr; &nLeftarrow;
⇎
&nhArr; &nLeftrightarrow;
⇏
&nrArr; &nRightarrow;
⇐
&lArr; &Leftarrow; &DoubleLeftArrow;
⇑
&uArr; &Uparrow; &DoubleUpArrow;
⇒
&rArr; &Rightarrow; &Implies; &DoubleRightArrow;
⇓
&dArr; &Downarrow; &DoubleDownArrow;
⇔
&hArr; &Leftrightarrow; &DoubleLeftRightArrow; &iff;
⇕
&vArr; &Updownarrow; &DoubleUpDownArrow;
⇖
&nwArr;
⇗
&neArr;
⇘
&seArr;
⇙
&swArr;
⇚
&lAarr; &Lleftarrow;
⇛
&rAarr; &Rrightarrow;
⇝
&zigrarr;
⇤
&larrb; &LeftArrowBar;
⇥
&rarrb; &RightArrowBar;
⇵
&duarr; &DownArrowUpArrow;
⇽
&loarr;
⇾
&roarr;
⇿
&hoarr;
∀
&forall; &ForAll;
∁
&comp; &complement;
∂
&part; &PartialD;
∃
&exist; &Exists;
∄
&nexist; &NotExists; &nexists;
∅
&empty; &emptyset; &emptyv; &varnothing;
∇
&nabla; &Del;
∈
&isin; &isinv; &Element; &in;
∉
&notin; &NotElement; &notinva;
∋
&niv; &ReverseElement; &ni; &SuchThat;
∌
&notni; &notniva; &NotReverseElement;
∏
&prod; &Product;
∐
&coprod; &Coproduct;
∑
&sum; &Sum;
−
&minus;
∓
&mnplus; &mp; &MinusPlus;
∔
&plusdo; &dotplus;
∖
&setmn; &setminus; &Backslash; &ssetmn; &smallsetminus;
∗
&lowast;
∘
&compfn; &SmallCircle;
√
&radic; &Sqrt;
∝
&prop; &propto; &Proportional; &vprop; &varpropto;
∞
&infin;
∟
&angrt;
∠
&ang; &angle;
∡
&angmsd; &measuredangle;
∢
&angsph;
∣
&mid; &VerticalBar; &smid; &shortmid;
∤
&nmid; &NotVerticalBar; &nsmid; &nshortmid;
∥
&par; &parallel; &DoubleVerticalBar; &spar; &shortparallel;
∦
&npar; &nparallel; &NotDoubleVerticalBar; &nspar; &nshortparallel;
∧
&and; &wedge;
∨
&or; &vee;
∩
&cap;
∪
&cup;
∫
&int; &Integral;
∬
&Int;
∭
&tint; &iiint;
∮
&conint; &oint; &ContourIntegral;
∯
&Conint; &DoubleContourIntegral;
∰
&Cconint;
∱
&cwint;
∲
&cwconint; &ClockwiseContourIntegral;
∳
&awconint; &CounterClockwiseContourIntegral;
∴
&there4; &therefore; &Therefore;
∵
&becaus; &because; &Because;
∶
&ratio;
∷
&Colon; &Proportion;
∸
&minusd; &dotminus;
∺
&mDDot;
∻
&homtht;
∼
&sim; &Tilde; &thksim; &thicksim;
∽
&bsim; &backsim;
∾
&ac; &mstpos;
∿
&acd;
≀
&wreath; &VerticalTilde; &wr;
≁
&nsim; &NotTilde;
≂
&esim; &EqualTilde; &eqsim;
≃
&sime; &TildeEqual; &simeq;
≄
&nsime; &nsimeq; &NotTildeEqual;
≅
&cong; &TildeFullEqual;
≆
&simne;
≇
&ncong; &NotTildeFullEqual;
≈
&asymp; &ap; &TildeTilde; &approx; &thkap; &thickapprox;
≉
&nap; &NotTildeTilde; &napprox;
≊
&ape; &approxeq;
≋
&apid;
≌
&bcong; &backcong;
≍
&asympeq; &CupCap;
≎
&bump; &HumpDownHump; &Bumpeq;
≏
&bumpe; &HumpEqual; &bumpeq;
≐
&esdot; &DotEqual; &doteq;
≑
&eDot; &doteqdot;
≒
&efDot; &fallingdotseq;
≓
&erDot; &risingdotseq;
≔
&colone; &coloneq; &Assign;
≕
&ecolon; &eqcolon;
≖
&ecir; &eqcirc;
≗
&cire; &circeq;
≙
&wedgeq;
≚
&veeeq;
≜
&trie; &triangleq;
≟
&equest; &questeq;
≠
&ne; &NotEqual;
≡
&equiv; &Congruent;
≢
&nequiv; &NotCongruent;
≤
&le; &leq;
≥
&ge; &GreaterEqual; &geq;
≦
&lE; &LessFullEqual; &leqq;
≧
&gE; &GreaterFullEqual; &geqq;
≨
&lnE; &lneqq;
≩
&gnE; &gneqq;
≪
&Lt; &NestedLessLess; &ll;
≫
&Gt; &NestedGreaterGreater; &gg;
≬
&twixt; &between;
≭
&NotCupCap;
≮
&nlt; &NotLess; &nless;
≯
&ngt; &NotGreater; &ngtr;
≰
&nle; &NotLessEqual; &nleq;
≱
&nge; &NotGreaterEqual; &ngeq;
≲
&lsim; &LessTilde; &lesssim;
≳
&gsim; &gtrsim; &GreaterTilde;
≴
&nlsim; &NotLessTilde;
≵
&ngsim; &NotGreaterTilde;
≶
&lg; &lessgtr; &LessGreater;
≷
&gl; &gtrless; &GreaterLess;
≸
&ntlg; &NotLessGreater;
≹
&ntgl; &NotGreaterLess;
≺
&pr; &Precedes; &prec;
≻
&sc; &Succeeds; &succ;
≼
&prcue; &PrecedesSlantEqual; &preccurlyeq;
≽
&sccue; &SucceedsSlantEqual; &succcurlyeq;
≾
&prsim; &precsim; &PrecedesTilde;
≿
&scsim; &succsim; &SucceedsTilde;
⊀
&npr; &nprec; &NotPrecedes;
⊁
&nsc; &nsucc; &NotSucceeds;
⊂
&sub; &subset;
⊃
&sup; &supset; &Superset;
⊄
&nsub;
⊅
&nsup;
⊆
&sube; &SubsetEqual; &subseteq;
⊇
&supe; &supseteq; &SupersetEqual;
⊈
&nsube; &nsubseteq; &NotSubsetEqual;
⊉
&nsupe; &nsupseteq; &NotSupersetEqual;
⊊
&subne; &subsetneq;
⊋
&supne; &supsetneq;
⊍
&cupdot;
⊎
&uplus; &UnionPlus;
⊏
&sqsub; &SquareSubset; &sqsubset;
⊐
&sqsup; &SquareSuperset; &sqsupset;
⊑
&sqsube; &SquareSubsetEqual; &sqsubseteq;
⊒
&sqsupe; &SquareSupersetEqual; &sqsupseteq;
⊓
&sqcap; &SquareIntersection;
⊔
&sqcup; &SquareUnion;
⊕
&oplus; &CirclePlus;
⊖
&ominus; &CircleMinus;
⊗
&otimes; &CircleTimes;
⊘
&osol;
⊙
&odot; &CircleDot;
⊚
&ocir; &circledcirc;
⊛
&oast; &circledast;
⊝
&odash; &circleddash;
⊞
&plusb; &boxplus;
⊟
&minusb; &boxminus;
⊠
&timesb; &boxtimes;
⊡
&sdotb; &dotsquare;
⊢
&vdash; &RightTee;
⊣
&dashv; &LeftTee;
⊤
&top; &DownTee;
⊥
&bottom; &bot; &perp; &UpTee;
⊧
&models;
⊨
&vDash; &DoubleRightTee;
⊩
&Vdash;
⊪
&Vvdash;
⊫
&VDash;
⊬
&nvdash;
⊭
&nvDash;
⊮
&nVdash;
⊯
&nVDash;
⊰
&prurel;
⊲
&vltri; &vartriangleleft; &LeftTriangle;
⊳
&vrtri; &vartriangleright; &RightTriangle;
⊴
&ltrie; &trianglelefteq; &LeftTriangleEqual;
⊵
&rtrie; &trianglerighteq; &RightTriangleEqual;
⊶
&origof;
⊷
&imof;
⊸
&mumap; &multimap;
⊹
&hercon;
⊺
&intcal; &intercal;
⊻
&veebar;
⊽
&barvee;
⊾
&angrtvb;
⊿
&lrtri;
⋀
&xwedge; &Wedge; &bigwedge;
⋁
&xvee; &Vee; &bigvee;
⋂
&xcap; &Intersection; &bigcap;
⋃
&xcup; &Union; &bigcup;
⋄
&diam; &diamond; &Diamond;
⋅
&sdot;
⋆
&sstarf; &Star;
⋇
&divonx; &divideontimes;
⋈
&bowtie;
⋉
&ltimes;
⋊
&rtimes;
⋋
&lthree; &leftthreetimes;
⋌
&rthree; &rightthreetimes;
⋍
&bsime; &backsimeq;
⋎
&cuvee; &curlyvee;
⋏
&cuwed; &curlywedge;
⋐
&Sub; &Subset;
⋑
&Sup; &Supset;
⋒
&Cap;
⋓
&Cup;
⋔
&fork; &pitchfork;
⋕
&epar;
⋖
&ltdot; &lessdot;
⋗
&gtdot; &gtrdot;
⋘
&Ll;
⋙
&Gg; &ggg;
⋚
&leg; &LessEqualGreater; &lesseqgtr;
⋛
&gel; &gtreqless; &GreaterEqualLess;
⋞
&cuepr; &curlyeqprec;
⋟
&cuesc; &curlyeqsucc;
⋠
&nprcue; &NotPrecedesSlantEqual;
⋡
&nsccue; &NotSucceedsSlantEqual;
⋢
&nsqsube; &NotSquareSubsetEqual;
⋣
&nsqsupe; &NotSquareSupersetEqual;
⋦
&lnsim;
⋧
&gnsim;
⋨
&prnsim; &precnsim;
⋩
&scnsim; &succnsim;
⋪
&nltri; &ntriangleleft; &NotLeftTriangle;
⋫
&nrtri; &ntriangleright; &NotRightTriangle;
⋬
&nltrie; &ntrianglelefteq; &NotLeftTriangleEqual;
⋭
&nrtrie; &ntrianglerighteq; &NotRightTriangleEqual;
⋮
&vellip;
⋯
&ctdot;
⋰
&utdot;
⋱
&dtdot;
⋲
&disin;
⋳
&isinsv;
⋴
&isins;
⋵
&isindot;
⋶
&notinvc;
⋷
&notinvb;
⋹
&isinE;
⋺
&nisd;
⋻
&xnis;
⋼
&nis;
⋽
&notnivc;
⋾
&notnivb;
⌅
&barwed; &barwedge;
⌆
&Barwed; &doublebarwedge;
⌈
&lceil; &LeftCeiling;
⌉
&rceil; &RightCeiling;
⌊
&lfloor; &LeftFloor;
⌋
&rfloor; &RightFloor;
⌌
&drcrop;
⌍
&dlcrop;
⌎
&urcrop;
⌏
&ulcrop;
⌐
&bnot;
⌒
&profline;
⌓
&profsurf;
⌕
&telrec;
⌖
&target;
⌜
&ulcorn; &ulcorner;
⌝
&urcorn; &urcorner;
⌞
&dlcorn; &llcorner;
⌟
&drcorn; &lrcorner;
⌢
&frown; &sfrown;
⌣
&smile; &ssmile;
⌭
&cylcty;
⌮
&profalar;
⌶
&topbot;
⌽
&ovbar;
⌿
&solbar;
⍼
&angzarr;
⎰
&lmoust; &lmoustache;
⎱
&rmoust; &rmoustache;
⎴
&tbrk; &OverBracket;
⎵
&bbrk; &UnderBracket;
⎶
&bbrktbrk;
⏜
&OverParenthesis;
⏝
&UnderParenthesis;
⏞
&OverBrace;
⏟
&UnderBrace;
⏢
&trpezium;
⏧
&elinters;
␣
&blank;
Ⓢ
&oS; &circledS;
─
&boxh; &HorizontalLine;
│
&boxv;
┌
&boxdr;
┐
&boxdl;
└
&boxur;
┘
&boxul;
├
&boxvr;
┤
&boxvl;
┬
&boxhd;
┴
&boxhu;
┼
&boxvh;
═
&boxH;
║
&boxV;
╒
&boxdR;
╓
&boxDr;
╔
&boxDR;
╕
&boxdL;
╖
&boxDl;
╗
&boxDL;
╘
&boxuR;
╙
&boxUr;
╚
&boxUR;
╛
&boxuL;
╜
&boxUl;
╝
&boxUL;
╞
&boxvR;
╟
&boxVr;
╠
&boxVR;
╡
&boxvL;
╢
&boxVl;
╣
&boxVL;
╤
&boxHd;
╥
&boxhD;
╦
&boxHD;
╧
&boxHu;
╨
&boxhU;
╩
&boxHU;
╪
&boxvH;
╫
&boxVh;
╬
&boxVH;
▀
&uhblk;
▄
&lhblk;
█
&block;
░
&blk14;
▒
&blk12;
▓
&blk34;
□
&squ; &square; &Square;
▪
&squf; &squarf; &blacksquare; &FilledVerySmallSquare;
▫
&EmptyVerySmallSquare;
▭
&rect;
▮
&marker;
▱
&fltns;
△
&xutri; &bigtriangleup;
▴
&utrif; &blacktriangle;
▵
&utri; &triangle;
▸
&rtrif; &blacktriangleright;
▹
&rtri; &triangleright;
▽
&xdtri; &bigtriangledown;
▾
&dtrif; &blacktriangledown;
▿
&dtri; &triangledown;
◂
&ltrif; &blacktriangleleft;
◃
&ltri; &triangleleft;
◊
&loz; &lozenge;
○
&cir;
◬
&tridot;
◯
&xcirc; &bigcirc;
◸
&ultri;
◹
&urtri;
◺
&lltri;
◻
&EmptySmallSquare;
◼
&FilledSmallSquare;
★
&starf; &bigstar;
☆
&star;
☎
&phone;
♀
&female;
♂
&male;
♠
&spades; &spadesuit;
♣
&clubs; &clubsuit;
♥
&hearts; &heartsuit;
♦
&diams; &diamondsuit;
♪
&sung;
♭
&flat;
♮
&natur; &natural;
♯
&sharp;
✓
&check; &checkmark;
✗
&cross;
✠
&malt; &maltese;
✶
&sext;
❘
&VerticalSeparator;
❲
&lbbrk;
❳
&rbbrk;
⟦
&lobrk; &LeftDoubleBracket;
⟧
&robrk; &RightDoubleBracket;
⟨
&lang; &LeftAngleBracket; &langle;
⟩
&rang; &RightAngleBracket; &rangle;
⟪
&Lang;
⟫
&Rang;
⟬
&loang;
⟭
&roang;
⟵
&xlarr; &longleftarrow; &LongLeftArrow;
⟶
&xrarr; &longrightarrow; &LongRightArrow;
⟷
&xharr; &longleftrightarrow; &LongLeftRightArrow;
⟸
&xlArr; &Longleftarrow; &DoubleLongLeftArrow;
⟹
&xrArr; &Longrightarrow; &DoubleLongRightArrow;
⟺
&xhArr; &Longleftrightarrow; &DoubleLongLeftRightArrow;
⟼
&xmap; &longmapsto;
⟿
&dzigrarr;
⤂
&nvlArr;
⤃
&nvrArr;
⤄
&nvHarr;
⤅
&Map;
⤌
&lbarr;
⤍
&rbarr; &bkarow;
⤎
&lBarr;
⤏
&rBarr; &dbkarow;
⤐
&RBarr; &drbkarow;
⤑
&DDotrahd;
⤒
&UpArrowBar;
⤓
&DownArrowBar;
⤖
&Rarrtl;
⤙
&latail;
⤚
&ratail;
⤛
&lAtail;
⤜
&rAtail;
⤝
&larrfs;
⤞
&rarrfs;
⤟
&larrbfs;
⤠
&rarrbfs;
⤣
&nwarhk;
⤤
&nearhk;
⤥
&searhk; &hksearow;
⤦
&swarhk; &hkswarow;
⤧
&nwnear;
⤨
&nesear; &toea;
⤩
&seswar; &tosa;
⤪
&swnwar;
⤳
&rarrc;
⤵
&cudarrr;
⤶
&ldca;
⤷
&rdca;
⤸
&cudarrl;
⤹
&larrpl;
⤼
&curarrm;
⤽
&cularrp;
⥅
&rarrpl;
⥈
&harrcir;
⥉
&Uarrocir;
⥊
&lurdshar;
⥋
&ldrushar;
⥎
&LeftRightVector;
⥏
&RightUpDownVector;
⥐
&DownLeftRightVector;
⥑
&LeftUpDownVector;
⥒
&LeftVectorBar;
⥓
&RightVectorBar;
⥔
&RightUpVectorBar;
⥕
&RightDownVectorBar;
⥖
&DownLeftVectorBar;
⥗
&DownRightVectorBar;
⥘
&LeftUpVectorBar;
⥙
&LeftDownVectorBar;
⥚
&LeftTeeVector;
⥛
&RightTeeVector;
⥜
&RightUpTeeVector;
⥝
&RightDownTeeVector;
⥞
&DownLeftTeeVector;
⥟
&DownRightTeeVector;
⥠
&LeftUpTeeVector;
⥡
&LeftDownTeeVector;
⥢
&lHar;
⥣
&uHar;
⥤
&rHar;
⥥
&dHar;
⥦
&luruhar;
⥧
&ldrdhar;
⥨
&ruluhar;
⥩
&rdldhar;
⥪
&lharul;
⥫
&llhard;
⥬
&rharul;
⥭
&lrhard;
⥮
&udhar; &UpEquilibrium;
⥯
&duhar; &ReverseUpEquilibrium;
⥰
&RoundImplies;
⥱
&erarr;
⥲
&simrarr;
⥳
&larrsim;
⥴
&rarrsim;
⥵
&rarrap;
⥶
&ltlarr;
⥸
&gtrarr;
⥹
&subrarr;
⥻
&suplarr;
⥼
&lfisht;
⥽
&rfisht;
⥾
&ufisht;
⥿
&dfisht;
⦅
&lopar;
⦆
&ropar;
⦋
&lbrke;
⦌
&rbrke;
⦍
&lbrkslu;
⦎
&rbrksld;
⦏
&lbrksld;
⦐
&rbrkslu;
⦑
&langd;
⦒

不完全,请跟踪完整文档的链接。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.