What are the differences between htmlspecialchars()
and htmlentities()
. When should I use one or the other?
From the PHP documentation for htmlentities:
This function is identical to
htmlspecialchars()
in all ways, except withhtmlentities()
, all characters which have HTML character entity equivalents are translated into these entities.
From the PHP documentation for htmlspecialchars:
Certain characters have special significance in HTML, and should be represented by HTML entities if they are to preserve their meanings. This function returns a string with some of these conversions made; the translations made are those most useful for everyday web programming. If you require all HTML character entities to be translated, use
htmlentities()
instead.
The difference is what gets encoded. The choices are everything (entities) or "special" characters, like ampersand, double and single quotes, less than, and greater than (specialchars).
I prefer to use htmlspecialchars
whenever possible.
For example:
echo htmlentities('<Il était une fois un être>.');
// Output: <Il était une fois un être>.
// ^^^^^^^^ ^^^^^^^
echo htmlspecialchars('<Il était une fois un être>.');
// Output: <Il était une fois un être>.
// ^ ^
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 < br >
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 < br >
echo htmlentities('µ †'); // This will print - µ †
One small example, I needed to have 2 client names indexed in a function:
[1] => Altisoxxce Soluxxons S.à r.l.
[5] => Joxxson & Joxxson
I originally $term = get_term_by('name', htmlentities($name), 'client');
which resulted in term names that only included the ampersand array item (&) but not the accented item. But when I changed the variable setting to htmlspecialchars
both were able to run through the function. Hope this helps!
Because:
htmlentities
substitutes more characters than htmlspecialchars
. This is unnecessary, makes the PHP script less efficient and the resulting HTML code less readable.htmlentities
is only necessary if your pages use encodings such as ASCII or LATIN-1 instead of UTF-8 and you're handling data with an encoding different from the page's.
**HTML Character Entity Reference Chart at W3.org**
https://dev.w3.org/html5/html-author/charref
	


!
!
"
" "
#
#
$
$
%
%
&
& &
'
'
(
(
)
)
*
* *
+
+
,
,
.
.
/
/
:
:
;
;
<
< <
=
=
>
> >
?
?
@
@
[
[ [
\
\
]
] ]
^
^
_
_
`
` `
{
{ {
|
| | |
}
} }
 
¡
¡
¢
¢
£
£
¤
¤
¥
¥
¦
¦
§
§
¨
¨ ¨ ¨ ¨
©
© ©
ª
ª
«
«
¬
¬
­
®
® ® ®
¯
¯ ‾ ¯
°
°
±
± ± ±
²
²
³
³
´
´ ´
µ
µ
¶
¶
·
· · ·
¸
¸ ¸
¹
¹
º
º
»
»
¼
¼
½
½ ½
¾
¾
¿
¿
À
À
Á
Á
Â
Â
Ã
Ã
Ä
Ä
Å
Å
Æ
Æ
Ç
Ç
È
È
É
É
Ê
Ê
Ë
Ë
Ì
Ì
Í
Í
Î
Î
Ï
Ï
Ð
Ð
Ñ
Ñ
Ò
Ò
Ó
Ó
Ô
Ô
Õ
Õ
Ö
Ö
×
×
Ø
Ø
Ù
Ù
Ú
Ú
Û
Û
Ü
Ü
Ý
Ý
Þ
Þ
ß
ß
à
à
á
á
â
â
ã
ã
ä
ä
å
å
æ
æ
ç
ç
è
è
é
é
ê
ê
ë
ë
ì
ì
í
í
î
î
ï
ï
ð
ð
ñ
ñ
ò
ò
ó
ó
ô
ô
õ
õ
ö
ö
÷
÷ ÷
ø
ø
ù
ù
ú
ú
û
û
ü
ü
ý
ý
þ
þ
ÿ
ÿ
Ā
Ā
ā
ā
Ă
Ă
ă
ă
Ą
Ą
ą
ą
Ć
Ć
ć
ć
Ĉ
Ĉ
ĉ
ĉ
Ċ
Ċ
ċ
ċ
Č
Č
č
č
Ď
Ď
ď
ď
Đ
Đ
đ
đ
Ē
Ē
ē
ē
Ė
Ė
ė
ė
Ę
Ę
ę
ę
Ě
Ě
ě
ě
Ĝ
Ĝ
ĝ
ĝ
Ğ
Ğ
ğ
ğ
Ġ
Ġ
ġ
ġ
Ģ
Ģ
Ĥ
Ĥ
ĥ
ĥ
Ħ
Ħ
ħ
ħ
Ĩ
Ĩ
ĩ
ĩ
Ī
Ī
ī
ī
Į
Į
į
į
İ
İ
ı
ı ı
IJ
IJ
ij
ij
Ĵ
Ĵ
ĵ
ĵ
Ķ
Ķ
ķ
ķ
ĸ
ĸ
Ĺ
Ĺ
ĺ
ĺ
Ļ
Ļ
ļ
ļ
Ľ
Ľ
ľ
ľ
Ŀ
Ŀ
ŀ
ŀ
Ł
Ł
ł
ł
Ń
Ń
ń
ń
Ņ
Ņ
ņ
ņ
Ň
Ň
ň
ň
ʼn
ʼn
Ŋ
Ŋ
ŋ
ŋ
Ō
Ō
ō
ō
Ő
Ő
ő
ő
Œ
Œ
œ
œ
Ŕ
Ŕ
ŕ
ŕ
Ŗ
Ŗ
ŗ
ŗ
Ř
Ř
ř
ř
Ś
Ś
ś
ś
Ŝ
Ŝ
ŝ
ŝ
Ş
Ş
ş
ş
Š
Š
š
š
Ţ
Ţ
ţ
ţ
Ť
Ť
ť
ť
Ŧ
Ŧ
ŧ
ŧ
Ũ
Ũ
ũ
ũ
Ū
Ū
ū
ū
Ŭ
Ŭ
ŭ
ŭ
Ů
Ů
ů
ů
Ű
Ű
ű
ű
Ų
Ų
ų
ų
Ŵ
Ŵ
ŵ
ŵ
Ŷ
Ŷ
ŷ
ŷ
Ÿ
Ÿ
Ź
Ź
ź
ź
Ż
Ż
ż
ż
Ž
Ž
ž
ž
ƒ
ƒ
Ƶ
Ƶ
ǵ
ǵ
ȷ
ȷ
ˆ
ˆ
ˇ
ˇ ˇ
˘
˘ ˘
˙
˙ ˙
˚
˚
˛
˛
˜
˜ ˜
˝
˝ ˝
̑
̑
̲
_
Α
Α
Β
Β
Γ
Γ
Δ
Δ
Ε
Ε
Ζ
Ζ
Η
Η
Θ
Θ
Ι
Ι
Κ
Κ
Λ
Λ
Μ
Μ
Ν
Ν
Ξ
Ξ
Ο
Ο
Π
Π
Ρ
Ρ
Σ
Σ
Τ
Τ
Υ
Υ
Φ
Φ
Χ
Χ
Ψ
Ψ
Ω
Ω
α
α
β
β
γ
γ
δ
δ
ε
ϵ ϵ ε
ζ
ζ
η
η
θ
θ
ι
ι
κ
κ
λ
λ
μ
μ
ν
ν
ξ
ξ
ο
ο
π
π
ρ
ρ
ς
ς ς ς
σ
σ
τ
τ
υ
υ υ
φ
φ ϕ ϕ
χ
χ
ψ
ψ
ω
ω
ϑ
ϑ ϑ ϑ
ϒ
ϒ ϒ
ϕ
ϕ
ϖ
ϖ ϖ
Ϝ
Ϝ
ϝ
ϝ ϝ
ϰ
ϰ ϰ
ϱ
ϱ ϱ
ϵ
ε ϵ
϶
϶ ϶
Ё
Ё
Ђ
Ђ
Ѓ
Ѓ
Є
Є
Ѕ
Ѕ
І
І
Ї
Ї
Ј
Ј
Љ
Љ
Њ
Њ
Ћ
Ћ
Ќ
Ќ
Ў
Ў
Џ
Џ
А
А
Б
Б
В
В
Г
Г
Д
Д
Е
Е
Ж
Ж
З
З
И
И
Й
Й
К
К
Л
Л
М
М
Н
Н
О
О
П
П
Р
Р
С
С
Т
Т
У
У
Ф
Ф
Х
Х
Ц
Ц
Ч
Ч
Ш
Ш
Щ
Щ
Ъ
Ъ
Ы
Ы
Ь
Ь
Э
Э
Ю
Ю
Я
Я
а
а
б
б
в
в
г
г
д
д
е
е
ж
ж
з
з
и
и
й
й
к
к
л
л
м
м
н
н
о
о
п
п
р
р
с
с
т
т
у
у
ф
ф
х
х
ц
ц
ч
ч
ш
ш
щ
щ
ъ
ъ
ы
ы
ь
ь
э
э
ю
ю
я
я
ё
ё
ђ
ђ
ѓ
ѓ
є
є
ѕ
ѕ
і
і
ї
ї
ј
ј
љ
љ
њ
њ
ћ
ћ
ќ
ќ
ў
ў
џ
џ
 
 
 
 
 
 
   
   
​ ​ ​ ​ ​
‌
‍
‎
‏
‐
‐ ‐
–
–
—
—
―
―
‖
‖ ‖
‘
‘ ‘
’
’ ’ ’
‚
‚ ‚
“
“ “
”
” ” ”
„
„ „
†
†
‡
‡ ‡
•
• •
‥
‥
…
… …
‰
‰
‱
‱
′
′
″
″
‴
‴
‵
‵ ‵
‹
‹
›
›
‾
‾
⁁
⁁
⁃
⁃
⁄
⁄
⁏
⁏
⁗
⁗
 
⁠
⁡ ⁡
⁢ ⁢
⁣ ⁣
€
€
⃛
⃛ ⃛
⃜
⃜
ℂ
ℂ ℂ
℅
℅
ℊ
ℊ
ℋ
ℋ ℋ ℋ
ℌ
ℌ ℌ
ℍ
ℍ ℍ
ℎ
ℎ
ℏ
ℏ ℏ ℏ ℏ
ℐ
ℐ ℐ
ℑ
ℑ ℑ ℑ ℑ
ℒ
ℒ ℒ ℒ
ℓ
ℓ
ℕ
ℕ ℕ
№
№
℗
℗
℘
℘ ℘
ℙ
ℙ ℙ
ℚ
ℚ ℚ
ℛ
ℛ ℛ
ℜ
ℜ ℜ ℜ ℜ
ℝ
ℝ ℝ
℞
℞
™
™ ™
ℤ
ℤ ℤ
Ω
Ω
℧
℧
ℨ
ℨ ℨ
℩
℩
Å
Å
ℬ
ℬ ℬ ℬ
ℭ
ℭ ℭ
ℯ
ℯ
ℰ
ℰ ℰ
ℱ
ℱ ℱ
ℳ
ℳ ℳ ℳ
ℴ
ℴ ℴ ℴ
ℵ
ℵ ℵ
ℶ
ℶ
ℷ
ℷ
ℸ
ℸ
ⅅ
ⅅ ⅅ
ⅆ
ⅆ ⅆ
ⅇ
ⅇ ⅇ ⅇ
ⅈ
ⅈ ⅈ
⅓
⅓
⅔
⅔
⅕
⅕
⅖
⅖
⅗
⅗
⅘
⅘
⅙
⅙
⅚
⅚
⅛
⅛
⅜
⅜
⅝
⅝
⅞
⅞
←
← ← ← ← ←
↑
↑ ↑ ↑ ↑
→
→ → → → →
↓
↓ ↓ ↓ ↓
↔
↔ ↔ ↔
↕
↕ ↕ ↕
↖
↖ ↖ ↖
↗
↗ ↗ ↗
↘
↘ ↘ ↘
↙
↙ ↙ ↙
↚
↚ ↚
↛
↛ ↛
↝
↝ ↝
↞
↞ ↞
↟
↟
↠
↠ ↠
↡
↡
↢
↢ ↢
↣
↣ ↣
↤
↤ ↤
↥
↥ ↥
↦
↦ ↦ ↦
↧
↧ ↧
↩
↩ ↩
↪
↪ ↪
↫
↫ ↫
↬
↬ ↬
↭
↭ ↭
↮
↮ ↮
↰
↰ ↰
↱
↱ ↱
↲
↲
↳
↳
↵
↵
↶
↶ ↶
↷
↷ ↷
↺
↺ ↺
↻
↻ ↻
↼
↼ ↼ ↼
↽
↽ ↽ ↽
↾
↾ ↾ ↾
↿
↿ ↿ ↿
⇀
⇀ ⇀ ⇀
⇁
⇁ ⇁ ⇁
⇂
⇂ ⇂ ⇂
⇃
⇃ ⇃ ⇃
⇄
⇄ ⇄ ⇄
⇅
⇅ ⇅
⇆
⇆ ⇆ ⇆
⇇
⇇ ⇇
⇈
⇈ ⇈
⇉
⇉ ⇉
⇊
⇊ ⇊
⇋
⇋ ⇋ ⇋
⇌
⇌ ⇌ ⇌
⇍
⇍ ⇍
⇎
⇎ ⇎
⇏
⇏ ⇏
⇐
⇐ ⇐ ⇐
⇑
⇑ ⇑ ⇑
⇒
⇒ ⇒ ⇒ ⇒
⇓
⇓ ⇓ ⇓
⇔
⇔ ⇔ ⇔ ⇔
⇕
⇕ ⇕ ⇕
⇖
⇖
⇗
⇗
⇘
⇘
⇙
⇙
⇚
⇚ ⇚
⇛
⇛ ⇛
⇝
⇝
⇤
⇤ ⇤
⇥
⇥ ⇥
⇵
⇵ ⇵
⇽
⇽
⇾
⇾
⇿
⇿
∀
∀ ∀
∁
∁ ∁
∂
∂ ∂
∃
∃ ∃
∄
∄ ∄ ∄
∅
∅ ∅ ∅ ∅
∇
∇ ∇
∈
∈ ∈ ∈ ∈
∉
∉ ∉ ∉
∋
∋ ∋ ∋ ∋
∌
∌ ∌ ∌
∏
∏ ∏
∐
∐ ∐
∑
∑ ∑
−
−
∓
∓ ∓ ∓
∔
∔ ∔
∖
∖ ∖ ∖ ∖ ∖
∗
∗
∘
∘ ∘
√
√ √
∝
∝ ∝ ∝ ∝ ∝
∞
∞
∟
∟
∠
∠ ∠
∡
∡ ∡
∢
∢
∣
∣ ∣ ∣ ∣
∤
∤ ∤ ∤ ∤
∥
∥ ∥ ∥ ∥ ∥
∦
∦ ∦ ∦ ∦ ∦
∧
∧ ∧
∨
∨ ∨
∩
∩
∪
∪
∫
∫ ∫
∬
∬
∭
∭ ∭
∮
∮ ∮ ∮
∯
∯ ∯
∰
∰
∱
∱
∲
∲ ∲
∳
∳ ∳
∴
∴ ∴ ∴
∵
∵ ∵ ∵
∶
∶
∷
∷ ∷
∸
∸ ∸
∺
∺
∻
∻
∼
∼ ∼ ∼ ∼
∽
∽ ∽
∾
∾ ∾
∿
∿
≀
≀ ≀ ≀
≁
≁ ≁
≂
≂ ≂ ≂
≃
≃ ≃ ≃
≄
≄ ≄ ≄
≅
≅ ≅
≆
≆
≇
≇ ≇
≈
≈ ≈ ≈ ≈ ≈ ≈
≉
≉ ≉ ≉
≊
≊ ≊
≋
≋
≌
≌ ≌
≍
≍ ≍
≎
≎ ≎ ≎
≏
≏ ≏ ≏
≐
≐ ≐ ≐
≑
≑ ≑
≒
≒ ≒
≓
≓ ≓
≔
≔ ≔ ≔
≕
≕ ≕
≖
≖ ≖
≗
≗ ≗
≙
≙
≚
≚
≜
≜ ≜
≟
≟ ≟
≠
≠ ≠
≡
≡ ≡
≢
≢ ≢
≤
≤ ≤
≥
≥ ≥ ≥
≦
≦ ≦ ≦
≧
≧ ≧ ≧
≨
≨ ≨
≩
≩ ≩
≪
≪ ≪ ≪
≫
≫ ≫ ≫
≬
≬ ≬
≭
≭
≮
≮ ≮ ≮
≯
≯ ≯ ≯
≰
≰ ≰ ≰
≱
≱ ≱ ≱
≲
≲ ≲ ≲
≳
≳ ≳ ≳
≴
≴ ≴
≵
≵ ≵
≶
≶ ≶ ≶
≷
≷ ≷ ≷
≸
≸ ≸
≹
≹ ≹
≺
≺ ≺ ≺
≻
≻ ≻ ≻
≼
≼ ≼ ≼
≽
≽ ≽ ≽
≾
≾ ≾ ≾
≿
≿ ≿ ≿
⊀
⊀ ⊀ ⊀
⊁
⊁ ⊁ ⊁
⊂
⊂ ⊂
⊃
⊃ ⊃ ⊃
⊄
⊄
⊅
⊅
⊆
⊆ ⊆ ⊆
⊇
⊇ ⊇ ⊇
⊈
⊈ ⊈ ⊈
⊉
⊉ ⊉ ⊉
⊊
⊊ ⊊
⊋
⊋ ⊋
⊍
⊍
⊎
⊎ ⊎
⊏
⊏ ⊏ ⊏
⊐
⊐ ⊐ ⊐
⊑
⊑ ⊑ ⊑
⊒
⊒ ⊒ ⊒
⊓
⊓ ⊓
⊔
⊔ ⊔
⊕
⊕ ⊕
⊖
⊖ ⊖
⊗
⊗ ⊗
⊘
⊘
⊙
⊙ ⊙
⊚
⊚ ⊚
⊛
⊛ ⊛
⊝
⊝ ⊝
⊞
⊞ ⊞
⊟
⊟ ⊟
⊠
⊠ ⊠
⊡
⊡ ⊡
⊢
⊢ ⊢
⊣
⊣ ⊣
⊤
⊤ ⊤
⊥
⊥ ⊥ ⊥ ⊥
⊧
⊧
⊨
⊨ ⊨
⊩
⊩
⊪
⊪
⊫
⊫
⊬
⊬
⊭
⊭
⊮
⊮
⊯
⊯
⊰
⊰
⊲
⊲ ⊲ ⊲
⊳
⊳ ⊳ ⊳
⊴
⊴ ⊴ ⊴
⊵
⊵ ⊵ ⊵
⊶
⊶
⊷
⊷
⊸
⊸ ⊸
⊹
⊹
⊺
⊺ ⊺
⊻
⊻
⊽
⊽
⊾
⊾
⊿
⊿
⋀
⋀ ⋀ ⋀
⋁
⋁ ⋁ ⋁
⋂
⋂ ⋂ ⋂
⋃
⋃ ⋃ ⋃
⋄
⋄ ⋄ ⋄
⋅
⋅
⋆
⋆ ⋆
⋇
⋇ ⋇
⋈
⋈
⋉
⋉
⋊
⋊
⋋
⋋ ⋋
⋌
⋌ ⋌
⋍
⋍ ⋍
⋎
⋎ ⋎
⋏
⋏ ⋏
⋐
⋐ ⋐
⋑
⋑ ⋑
⋒
⋒
⋓
⋓
⋔
⋔ ⋔
⋕
⋕
⋖
⋖ ⋖
⋗
⋗ ⋗
⋘
⋘
⋙
⋙ ⋙
⋚
⋚ ⋚ ⋚
⋛
⋛ ⋛ ⋛
⋞
⋞ ⋞
⋟
⋟ ⋟
⋠
⋠ ⋠
⋡
⋡ ⋡
⋢
⋢ ⋢
⋣
⋣ ⋣
⋦
⋦
⋧
⋧
⋨
⋨ ⋨
⋩
⋩ ⋩
⋪
⋪ ⋪ ⋪
⋫
⋫ ⋫ ⋫
⋬
⋬ ⋬ ⋬
⋭
⋭ ⋭ ⋭
⋮
⋮
⋯
⋯
⋰
⋰
⋱
⋱
⋲
⋲
⋳
⋳
⋴
⋴
⋵
⋵
⋶
⋶
⋷
⋷
⋹
⋹
⋺
⋺
⋻
⋻
⋼
⋼
⋽
⋽
⋾
⋾
⌅
⌅ ⌅
⌆
⌆ ⌆
⌈
⌈ ⌈
⌉
⌉ ⌉
⌊
⌊ ⌊
⌋
⌋ ⌋
⌌
⌌
⌍
⌍
⌎
⌎
⌏
⌏
⌐
⌐
⌒
⌒
⌓
⌓
⌕
⌕
⌖
⌖
⌜
⌜ ⌜
⌝
⌝ ⌝
⌞
⌞ ⌞
⌟
⌟ ⌟
⌢
⌢ ⌢
⌣
⌣ ⌣
⌭
⌭
⌮
⌮
⌶
⌶
⌽
⌽
⌿
⌿
⍼
⍼
⎰
⎰ ⎰
⎱
⎱ ⎱
⎴
⎴ ⎴
⎵
⎵ ⎵
⎶
⎶
⏜
⏜
⏝
⏝
⏞
⏞
⏟
⏟
⏢
⏢
⏧
⏧
␣
␣
Ⓢ
Ⓢ Ⓢ
─
─ ─
│
│
┌
┌
┐
┐
└
└
┘
┘
├
├
┤
┤
┬
┬
┴
┴
┼
┼
═
═
║
║
╒
╒
╓
╓
╔
╔
╕
╕
╖
╖
╗
╗
╘
╘
╙
╙
╚
╚
╛
╛
╜
╜
╝
╝
╞
╞
╟
╟
╠
╠
╡
╡
╢
╢
╣
╣
╤
╤
╥
╥
╦
╦
╧
╧
╨
╨
╩
╩
╪
╪
╫
╫
╬
╬
▀
▀
▄
▄
█
█
░
░
▒
▒
▓
▓
□
□ □ □
▪
▪ ▪ ▪ ▪
▫
▫
▭
▭
▮
▮
▱
▱
△
△ △
▴
▴ ▴
▵
▵ ▵
▸
▸ ▸
▹
▹ ▹
▽
▽ ▽
▾
▾ ▾
▿
▿ ▿
◂
◂ ◂
◃
◃ ◃
◊
◊ ◊
○
○
◬
◬
◯
◯ ◯
◸
◸
◹
◹
◺
◺
◻
◻
◼
◼
★
★ ★
☆
☆
☎
☎
♀
♀
♂
♂
♠
♠ ♠
♣
♣ ♣
♥
♥ ♥
♦
♦ ♦
♪
♪
♭
♭
♮
♮ ♮
♯
♯
✓
✓ ✓
✗
✗
✠
✠ ✠
✶
✶
❘
❘
❲
❲
❳
❳
⟦
⟦ ⟦
⟧
⟧ ⟧
⟨
⟨ ⟨ ⟨
⟩
⟩ ⟩ ⟩
⟪
⟪
⟫
⟫
⟬
⟬
⟭
⟭
⟵
⟵ ⟵ ⟵
⟶
⟶ ⟶ ⟶
⟷
⟷ ⟷ ⟷
⟸
⟸ ⟸ ⟸
⟹
⟹ ⟹ ⟹
⟺
⟺ ⟺ ⟺
⟼
⟼ ⟼
⟿
⟿
⤂
⤂
⤃
⤃
⤄
⤄
⤅
⤅
⤌
⤌
⤍
⤍ ⤍
⤎
⤎
⤏
⤏ ⤏
⤐
⤐ ⤐
⤑
⤑
⤒
⤒
⤓
⤓
⤖
⤖
⤙
⤙
⤚
⤚
⤛
⤛
⤜
⤜
⤝
⤝
⤞
⤞
⤟
⤟
⤠
⤠
⤣
⤣
⤤
⤤
⤥
⤥ ⤥
⤦
⤦ ⤦
⤧
⤧
⤨
⤨ ⤨
⤩
⤩ ⤩
⤪
⤪
⤳
⤳
⤵
⤵
⤶
⤶
⤷
⤷
⤸
⤸
⤹
⤹
⤼
⤼
⤽
⤽
⥅
⥅
⥈
⥈
⥉
⥉
⥊
⥊
⥋
⥋
⥎
⥎
⥏
⥏
⥐
⥐
⥑
⥑
⥒
⥒
⥓
⥓
⥔
⥔
⥕
⥕
⥖
⥖
⥗
⥗
⥘
⥘
⥙
⥙
⥚
⥚
⥛
⥛
⥜
⥜
⥝
⥝
⥞
⥞
⥟
⥟
⥠
⥠
⥡
⥡
⥢
⥢
⥣
⥣
⥤
⥤
⥥
⥥
⥦
⥦
⥧
⥧
⥨
⥨
⥩
⥩
⥪
⥪
⥫
⥫
⥬
⥬
⥭
⥭
⥮
⥮ ⥮
⥯
⥯ ⥯
⥰
⥰
⥱
⥱
⥲
⥲
⥳
⥳
⥴
⥴
⥵
⥵
⥶
⥶
⥸
⥸
⥹
⥹
⥻
⥻
⥼
⥼
⥽
⥽
⥾
⥾
⥿
⥿
⦅
⦅
⦆
⦆
⦋
⦋
⦌
⦌
⦍
⦍
⦎
⦎
⦏
⦏
⦐
⦐
⦑
⦑
⦒
Not fully, pls track the link for fully document.
You should use htmlspecialchars($strText, ENT_QUOTES)
when you just want your string to be XML and HTML safe:
For example, encode
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: