htmlspecialchars()htmlentities()有什么区别?什么时候应该使用其中一个?

#1 楼

从htmlentities的PHP文档中:


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


来自PHP文档的htmlspecialchars:


某些字符在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;.
    //                ^                 ^
 


评论


感谢您的回答,但是除了明显的区别之外,您是否愿意详细说明您更喜欢htmlspecialchars()的东西?在什么情况下使用htmlentities()会导致问题,而htmlspecialchars()不会?

– MikeSchinkel
11年15月15日在19:28

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

– Darius
2012年5月27日晚上8:13

@Darius您所说的没有任何意义。 htmlentities和htmlspecialchars都可以处理UTF-8,只要为第三个参数指定“ UTF-8”即可。

– Artefacto
2012年5月27日13:03

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

–乔纳森
13年3月19日在15:23

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

– rinogo
13年4月10日在1:43

#2 楼

htmlspecialchars可以用于:




当不需要编码所有具有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字符集,则不会造成任何问题。

不仅仅通过浏览器(以避免解码HTML实体),
如果输出是XML(请参见Artefacto的答案)。


评论


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

–塔里克
2015年12月25日在21:41

#3 楼

正在使用htmlentities对其进行编码。

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


“&<>
¡¢£¤¥¦§§©©««¬®°±²³³µ ¶·¸º»¼½¾¿ÀÇÇÇ<<<<×××ØØÛÜßßã äåççééëÉððóö÷úýýbr br br br br br br br br br br br br br br br br br br br br br brΑΑΑΑΑΑ ΛΜΡΡαβββββbr br br br br br br ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ – —'',“”†‡•…‰'” ‹›〜⁄€ℑ℘™™←←↑→↓↓⇑⇑⇒⇓⇔
∀∂∇∈∈∈∏ ∑ − ∗√∝∞∠∧∫∫〜≈≈≠≡≤≥⊂⊃⊆ ♥⋅⋅br
♦♥♦


htmlspecialchars编码。

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


“&<>


评论


Beware! At first glance, htmlentities looks pretty complete. But it's missing a bunch of really basic and common characters (especially if your clients like MS). Smart quotes (e.g., ’ or ’), dashes (e.g., — or &mdash), trademark sign (™ or ™), and many others will cause it to return null.

– Jonathan Lidbeck
Oct 16 '14 at 4:29



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

– Artefacto
15年3月16日在16:19

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

– Aaa
17年7月8日在19:46



这些列表中未显示的是(1)两个函数都对空格进行编码(如%20),以及(2)您可以设置标志(ENT_QUOTES),以便它们也对单引号进行编码。

–杰里米·杨(Jeremy Young)
8月30日15:17

#4 楼

因为:


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

htmlentities仅在您的网页使用ASCII或LATIN-1等编码而不是UTF-8且您需要“用与页面不同的编码重新处理数据。

#5 楼

You should use htmlspecialchars($strText, ENT_QUOTES) when you just want your string to be XML and HTML safe:

For example, encode


& to &
" to "
< to <
> to >
' to '

However, if you also have additional characters that are Unicode or uncommon symbols in your text then you should use htmlentities() to ensure they show up properly in your HTML page.

Notes:


' will only be encoded by htmlspecialchars() to ' if the ENT_QUOTES option is passed in. ' is safer to use then ' since older versions of Internet Explorer do not support the ' entity.
Technically, > does not need to be encoded as per the XML specification, but it is usually encoded too for consistency with the requirement of < being encoded.


评论


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

– EKanadily
16年8月2日在12:29

#6 楼

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

#7 楼

我刚刚发现了get_html_translation_table函数。您将其传递给HTML_ENTITIESHTML_SPECIALCHARS,它将返回一个数组,其中包含将要编码的字符及其编码方式。

评论


当您要创建自己的功能(例如替换一些其他字符或执行其他魔术操作)时,这很有用。

– Jochem Kuijpers
13年2月24日在0:04

#8 楼

htmlentities — Convert all applicable characters to HTML entities.

htmlspecialchars — Convert special characters to HTML entities.

The translations performed translation characters on the below:


'&' (ampersand) becomes '&'
'"' (double quote) becomes '"' when ENT_NOQUOTES is not set.
"'" (single quote) becomes ''' (or ') only when ENT_QUOTES is set.
'<' (less than) becomes '<'
'>' (greater than) becomes '>'

You can check the following code for more information about what's htmlentities and htmlspecialchars:

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

#9 楼

您可能要使用一些Unicode字符编码,例如UTF-8和htmlspecialchars。因为没有必要为“所有[适用]字符”生成“ HTML实体”(即htmlentities根据文档进行的操作)(如果它已经存在于您的字符集中)。

#10 楼

The differences between htmlspecialchars() and htmlentities() is very small. Lets see some examples:


htmlspecialchars


htmlspecialchars(string $string) takes multiple arguments where as the first argument is a string and all other arguments (certain flags, certain encodings etc. ) are optional. htmlspecialchars converts special characters in the string to HTML entities. For example if you have < br > in your string, htmlspecialchars will convert it into < b >. Whereas characters like µ † etc. have no special significance in HTML. So they will be not converted to HTML entities by htmlspecialchars function as shown in the below example.

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



htmlentities


htmlentities ( string $string) is very similar to htmlspecialchars and takes multiple arguments where as the first argument is a string and all other arguments are optional (certain flags, certain encodings etc.). Unlike htmlspecialchars, htmlentities converts not only special characters in the string to HTML entities but all applicable characters to HTML entities.

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


#11 楼

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

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


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

#12 楼

**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;
ĉ
&ccirc;
Ċ
&Cdot;
ċ
&cdot;
Č
&Ccaron;
č
&ccaron;
Ď
&Dcaron;
ď
&dcaron;
Đ
&Dstrok;
đ
&dstrok;
Ē
&Emacr;
ē
&emacr;
Ė
&Edot;
ė
&edot;
Ę
&Eogon;
ę
&eogon;
Ě
&Ecaron;
ě
&ecaron;
Ĝ
&Gcirc;
ĝ
&gcirc;
Ğ
&Gbreve;
ğ
&gbreve;
Ġ
&Gdot;
ġ
&gdot;
Ģ
&Gcedil;
Ĥ
&Hcirc;
ĥ
&hcirc;
Ħ
&Hstrok;
ħ
&hstrok;
Ĩ
&Itilde;
ĩ
&itilde;
Ī
&Imacr;
ī
&imacr;
Į
&Iogon;
į
&iogon;
İ
&Idot;
ı
&imath; &inodot;
IJ
&IJlig;
ij
&ijlig;
Ĵ
&Jcirc;
ĵ
&jcirc;
Ķ
&Kcedil;
ķ
&kcedil;
ĸ
&kgreen;
Ĺ
&Lacute;
ĺ
&lacute;
Ļ
&Lcedil;
ļ
&lcedil;
Ľ
&Lcaron;
ľ
&lcaron;
Ŀ
&Lmidot;
ŀ
&lmidot;
Ł
&Lstrok;
ł
&lstrok;
Ń
&Nacute;
ń
&nacute;
Ņ
&Ncedil;
ņ
&nc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&ocy;
п
&pcy;
р
&rcy;
с
&scy;
т
&tcy;
у
&ucy;
ф
&fcy;
х
&khcy;
ц
&tscy;
ч
&chcy;
ш
&shcy;
щ
&shchcy;
ъ
&hardcy;
ы
&ycy;
ь
&softcy;
э
&ecy;
ю
&yucy;
я
&yacy;
ё
&iocy;
ђ
&djcy;
ѓ
&gjcy;
є
&jukcy;
ѕ
&dscy;
і
&iukcy;
ї
&yicy;
ј
&jsercy;
љ
&ljcy;
њ
&njcy;
ћ
&tshcy;
ќ
&kjcy;
ў
&ubrcy;
џ
&dzcy;
 
&ensp;
 
&emsp;
 
&emsp13;
 
&emsp14;
 
&numsp;
 
&puncsp;
 
&thinsp; &ThinSpace;
 
&hairsp; &VeryThinSpace;
​
&ZeroWidthSpace; &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;
⦒


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