当前位置: 首页> 函数类别大全> get_html_translation_table

get_html_translation_table

返回使用 htmlspecialchars() 和 htmlentities() 后的转换表
名称:get_html_translation_table
分类:字符串
所属语言:php
一句话介绍:返回由 htmlspecialchars() 和 htmlentities() 使用的翻译表。

实例

例子 1

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

<span class="token php language-php"><span class="token delimiter important"><?php</span>
<span class="token function">print_r</span> <span class="token punctuation">(</span><span class="token function">get_html_translation_table</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">// HTML_SPECIALCHARS 为默认</span>
<span class="token delimiter important">?></span></span>

亲自试一试

例子 2

HTML_SPECIALCHARS 的翻译表:

<span class="token php language-php"><span class="token delimiter important"><?php</span>
<span class="token function">print_r</span> <span class="token punctuation">(</span><span class="token function">get_html_translation_table</span><span class="token punctuation">(</span><span class="token constant">HTML_SPECIALCHARS</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token delimiter important">?></span></span>

显示字符和实体名:

Array
(
  ["] => "
  [&] => &
  [<] => <
  [>] => >
)

例子 3

HTML_ENTITIES 的翻译表:

<span class="token php language-php"><span class="token delimiter important"><?php</span>
<span class="token function">print_r</span> <span class="token punctuation">(</span><span class="token function">get_html_translation_table</span><span class="token punctuation">(</span><span class="token constant">HTML_ENTITIES</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token delimiter important">?></span></span>

显示字符和实体名:

Array
(
  ["] => "
  [&] => &
  [<] => <
  [>] => >
  [ ] => &nbsp;
  [?] => ?
  [?] => ¢
  [?] => £
  [?] => ¤
  [?] => ¥
  [?] => |
  [?] => §
  [?] => ¨
  [?] => ?
  [?] => a
  [?] => ?
  [?] => ?
  [?] => -
  [?] => ?
  [?] => ˉ
  [?] => °
  [?] => ±
  [?] => 2
  [?] => 3
  [?] => ′
  [?] => μ
  [?] => ?
  [?] => ·
  [?] => ?
  [?] => 1
  [?] => o
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => à
  [?] => á
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => è
  [?] => é
  [?] => ê
  [?] => ?
  [?] => ì
  [?] => í
  [?] => ?
  [?] => ?
  [?] => D
  [?] => ?
  [?] => ò
  [?] => ó
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ×
  [?] => ?
  [?] => ù
  [?] => ú
  [?] => ?
  [?] => ü
  [?] => Y
  [?] => T
  [?] => ?
  [?] => à
  [?] => á
  [?] => a
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => è
  [?] => é
  [?] => ê
  [?] => ?
  [?] => ì
  [?] => í
  [?] => ?
  [?] => ?
  [?] => e
  [?] => ?
  [?] => ò
  [?] => ó
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ÷
  [?] => ?
  [?] => ù
  [?] => ú
  [?] => ?
  [?] => ü
  [?] => y
  [?] => t
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?

  [?] => ?
  [?] => ?
  [?] => ?
  [Α] => Α
  [Β] => Β
  [Γ] => Γ
  [Δ] => Δ
  [Ε] => Ε
  [Ζ] => Ζ
  [Η] => Η
  [Θ] => Θ
  [Ι] => Ι
  [Κ] => Κ
  [Λ] => Λ
  [Μ] => Μ
  [Ν] => Ν
  [Ξ] => Ξ
  [Ο] => Ο
  [Π] => Π
  [Ρ] => Ρ
  [Σ] => Σ
  [Τ] => Τ
  [Υ] => Υ
  [Φ] => Φ
  [Χ] => Χ
  [Ψ] => Ψ
  [Ω] => Ω
  [α] => α
  [β] => β
  [γ] => γ
  [δ] => δ
  [ε] => ε
  [ζ] => ζ
  [η] => η
  [θ] => θ
  [ι] => ι
  [κ] => κ
  [λ] => λ
  [μ] => μ
  [ν] => ν
  [ξ] => ξ
  [ο] => ο
  [π] => π
  [ρ] => ρ
  [?] => ?
  [σ] => σ
  [τ] => τ
  [υ] => υ
  [φ] => φ
  [χ] => χ
  [ψ] => ψ
  [ω] => ω
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => –
  [?] => —
  [?] => ‘
  [?] => ’
  [?] => ?
  [?] => “
  [?] => ”
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => …
  [?] => ‰
  [′] => ′
  [″] => ″
  [?] => ?
  [?] => ?
  [ ̄] =>  ̄
  [?] => ?
  [?] => €
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [←] => ←
  [↑] => ↑
  [→] => →
  [↓] => ↓
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [∈] => ∈
  [?] => ?
  [?] => ?
  [∏] => ∏
  [∑] => ∑
  [?] => ?
  [?] => ?
  [√] => √
  [∝] => ∝
  [∞] => ∞
  [∠] => ∠
  [∧] => ∧
  [∨] => ∨
  [∩] => ∩
  [∪] => ∪
  [∫] => ∫
  [∴] => ∴
  [~] => ~
  [?] => ?
  [≈] => ≈
  [≠] => ≠
  [≡] => ≡
  [≤] => ≤
  [≥] => ≥
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [⊕] => ⊕
  [?] => ?
  [⊥] => ⊥
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
  [?] => ?
)
同类函数
  • 使用“自然顺序”算法进行字符串比较 strnatcmp

    strnatcmp

    使用“自然顺序”算法进行字符串比较
  • 判断一个字符串中是否包含一个给定的子字符串 str_contains

    str_contains

    判断一个字符串中是否包含一个给定的子字符
  • 计算子字符串出现次数 substr_count

    substr_count

    计算子字符串出现次数
  • 获取不匹配遮罩的起始子字符串的长度 strcspn

    strcspn

    获取不匹配遮罩的起始子字符串的长度
  • 计算指定字符串在目标字符串中最后一次出现的位置(不区分大小写) strripos

    strripos

    计算指定字符串在目标字符串中最后一次出现
  • 计算指定字符串在目标字符串中最后一次出现的位置 strrpos

    strrpos

    计算指定字符串在目标字符串中最后一次出现
  • 将二进制数据转换为十六进制表示 bin2hex

    bin2hex

    将二进制数据转换为十六进制表示
  • 计算两个字符串之间的相似性 similar_text

    similar_text

    计算两个字符串之间的相似性