PHP get_html_translation_table()函数用法讲解

PHP get_html_translation_table() 函数

实例

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

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

定义和用法

get_html_translation_table()函数返回htmlentities()htmlspecialchars()函数使用的翻译表。

提示:一些字符可以按照若干种方式进行编码。get_html_translation_table() 函数返回最普通的编码。

语法

get_html_translation_table( _function,flags,character-set_ )

实例

HTML_SPECIALCHARS 的翻译表:

<?php
print_r (get_html_translation_table(HTML_SPECIALCHARS));
?>
Displaying character and entity name:
Array
(
["] => "
[&] => &
[<] => <
[>] => >
)

实例 2

HTML_ENTITIES 的翻译表:

<?php
print_r (get_html_translation_table(HTML_ENTITIES));
?>

显示字符及其对应的实体名称:

Array 

["] => " 
[&] => & 
[<] => < 
[>] => > 
[ ] =>   
[¡] => ¡ 
[¢] => ¢ 
[£] => £ 
[¤] => ¤ 
[¥] => ¥ 
[¦] => ¦ 
[§] => § 
[¨] => ¨ 
[©] => © 
[ª] => ª 
[«] => « 
[¬] => ¬ 
[­] => ­ 
[®] => ® 
[¯] => ¯ 
[°] => ° 
[±] => ± 
[²] => ² 
[³] => ³ 
[´] => ´ 
[µ] => µ 
[¶] => ¶ 
[·] => · 
[¸] => ¸ 
[¹] => ¹ 
[º] => º 
[»] => » 
[¼] => ¼ 
[½] => ½ 
[¾] => ¾ 
[¿] => ¿ 
[À] => À 
[Á] => Á 
[Â] =>  
[Ã] => à
[Ä] => Ä 
[Å] => Å 
[Æ] => Æ 
[Ç] => Ç 
[È] => È 
[É] => É 
[Ê] => Ê 
[Ë] => Ë 
[Ì] => Ì 
[Í] => Í 
[Î] => Π
[Ï] => Ï 
[Ð] => Р
[Ñ] => Ñ 
[Ò] => Ò 
[Ó] => Ó 
[Ô] => Ô 
[Õ] => Õ 
[Ö] => Ö 
[×] => × 
[Ø] => Ø 
[Ù] => Ù 
[Ú] => Ú 
[Û] => Û 
[Ü] => Ü 
[Ý] => Ý 
[Þ] => Þ 
[ß] => ß 
[à] => à 
[á] => á 
[â] => â 
[ã] => ã 
[ä] => ä 
[å] => å 
[æ] => æ 
[ç] => ç 
[è] => è 
[é] => é 
[ê] => ê 
[ë] => ë 
[ì] => ì 
[í] => í 
[î] => î 
[ï] => ï 
[ð] => ð 
[ñ] => ñ 
[ò] => ò 
[ó] => ó 
[ô] => ô 
[õ] => õ 
[ö] => ö 
[÷] => ÷ 
[ø] => ø 
[ù] => ù 
[ú] => ú 
[û] => û 
[ü] => ü 
[ý] => ý 
[þ] => þ 
[ÿ] => ÿ 
[Œ] => Œ 
[œ] => œ 
[Š] => Š 
[š] => š 
[Ÿ] => Ÿ 
[ƒ] => ƒ 
[ˆ] => ˆ 
[˜] => ˜ 
[Α] => Α 
[Β] => Β 
[Γ] => Γ 
[Δ] => Δ 
[Ε] => Ε 
[Ζ] => Ζ 
[Η] => Η 
[Θ] => Θ 
[Ι] => Ι 
[Κ] => Κ 
[Λ] => Λ 
[Μ] => Μ 
[Ν] => Ν 
[Ξ] => Ξ 
[Ο] => Ο 
[Π] => Π 
[Ρ] => Ρ 
[Σ] => Σ 
[Τ] => Τ 
[Υ] => Υ 
[Φ] => Φ 
[Χ] => Χ 
[Ψ] => Ψ 
[Ω] => Ω 
[α] => α 
[β] => β 
[γ] => γ 
[δ] => δ 
[ε] => ε 
[ζ] => ζ 
[η] => η 
[θ] => θ 
[ι] => ι 
[κ] => κ 
[λ] => λ 
[μ] => μ 
[ν] => ν 
[ξ] => ξ 
[ο] => ο 
[π] => π 
[ρ] => ρ 
[ς] => ς 
[σ] => σ 
[τ] => τ 
[υ] => υ 
[φ] => φ 
[χ] => χ 
[ψ] => ψ 
[ω] => ω 
[ϑ] => ϑ 
[ϒ] => ϒ 
[ϖ] => ϖ 
[ ] =>   
[ ] =>   
[ ] =>   
[‌] => ‌ 
[‍] => ‍ 
[‎] => ‎ 
[‏] => ‏ 
[–] => – 
[—] => — 
['] => ‘ 
['] => ’ 
[‚] => ‚ 
["] => “ 
["] => ” 
[„] => „ 
[†] => † 
[‡] => ‡ 
[•] => • 
[…] => … 
[‰] => ‰ 
[′] => ′ 
[″] => ″ 
[‹] => ‹ 
[›] => › 
[‾] => ‾ 
[⁄] => ⁄ 
[€] => € 
[ℑ] => ℑ 
[℘] => ℘ 
[ℜ] => ℜ 
[™] => ™ 
[ℵ] => ℵ 
[←] => ← 
[↑] => ↑ 
[→] => → 
[↓] => ↓ 
[↔] => ↔ 
[↵] => ↵ 
[⇐] => ⇐ 
[⇑] => ⇑ 
[⇒] => ⇒ 
[⇓] => ⇓ 
[⇔] => ⇔ 
[∀] => ∀ 
[∂] => ∂ 
[∃] => ∃ 
[∅] => ∅ 
[∇] => ∇ 
[∈] => ∈ 
[∉] => ∉ 
[∋] => ∋ 
[∏] => ∏ 
[∑] => ∑ 
[−] => − 
[∗] => ∗ 
[√] => √ 
[∝] => ∝ 
[∞] => ∞ 
[∠] => ∠ 
[∧] => ∧ 
[∨] => ∨ 
[∩] => ∩ 
[∪] => ∪ 
[∫] => ∫ 
[∴] => ∴ 
[∼] => ∼ 
[≅] => ≅ 
[≈] => ≈ 
[≠] => ≠ 
[≡] => ≡ 
[≤] => ≤ 
[≥] => ≥ 
[⊂] => ⊂ 
[⊃] => ⊃ 
[⊄] => ⊄ 
[⊆] => ⊆ 
[⊇] => ⊇ 
[⊕] => ⊕ 
[⊗] => ⊗ 
[⊥] => ⊥ 
[⋅] => ⋅ 
[⌈] => ⌈ 
[⌉] => ⌉ 
[⌊] => ⌊ 
[⌋] => ⌋ 
[〈] => ⟨ 
[〉] => ⟩ 
[◊] => ◊ 
[♠] => ♠ 
[♣] => ♣ 
[♥] => ♥ 
[♦] => ♦ 
)

总结

以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对我们的支持。如果你想了解更多相关内容请查看下面相关链接

(0)

相关推荐

  • PHP hebrev()函数用法讲解

    PHP hebrev() 函数 实例 反向显示希伯来字符: <?php echo hebrev("á çùåï äúùñâ"); ?> 定义和用法 hebrev()函数把希伯来文本从右至左的流转换为左至右的流. 提示: hebrev() 和 hebrevc() 可以把希伯来逻辑文本(Windows 编码)转换为希伯来可见文本.希伯来可见文本不需要特殊的从右至左字符支持,这使它对于在 Web 上显示希伯来文本很有用处. 语法 hebrev( _string,maxcharli

  • asp函数split()对应php函数explode()

    <?php //利用 explode 函数分割字符串到数组 $source = "hello1,hello2,hello3,hello4,hello5";//按逗号分离字符串 $hello = explode(',',$source); for($i=0;$i<count($hello);$i++){ echo $hello[$i];echo "</br>"; } ?> 截取去掉最后/第一个字符 $newstr = substr($st

  • PHP hex2bin()函数用法讲解

    PHP hex2bin() 函数 实例 把十六进制值转换为 ASCII 字符: <?php echo hex2bin("48656c6c6f20576f726c6421"); ?> 以上实例输出结果: Hello World! 定义和用法 hex2bin()函数把十六进制值的字符串转换为 ASCII 字符. 语法 hex2bin( _string_ ) 总结 以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对我们的支持.如果你

  • PHP htmlentities()函数用法讲解

    PHP htmlentities() 函数 实例 把一些字符转换为 HTML 实体: <?php $str = "<© W3CSçh°°¦§>"; echo htmlentities($str); ?> 上面代码的 HTML 输出如下(查看源代码): <!DOCTYPE html> <html> <body> <© W3CSçh°°¦§> </body> </html> 上面代码的浏览器输出

  • PHP html_entity_decode()函数讲解

    PHP html_entity_decode() 函数 实例 把 HTML 实体转换为字符: <?php $str = "<© W3CSçh°°¦§>"; echo html_entity_decode($str); ?> 上面代码的 HTML 输出如下(查看源代码): <!DOCTYPE html> <html> <body> <© W3CSçh°°¦§> </body> </html>

  • PHP判断是否是微信打开还是浏览器打开的方法

    /** * 方法一:判断判断是否是微信打开(试过,可以) */ $ua = $_SERVER['HTTP_USER_AGENT']; if (strpos($ua, 'MicroMessenger') == false && strpos($ua, 'Windows Phone') == false) { echo '普通浏览器打开'.$wxpay_type; //跳转移动端页面 $alipay_type=5;//支付宝移动支付 $wxpay_type=3;//微信H5支付 } else

  • PHP正则验证字符串是否为数字的两种方法并附常用正则

    php 正则验证字符串是否为数字 方法一: php中利用正则表达式验证字符串是否为数字一件非常容易的事情,最主要的是如何写好正则表达式以及掌握正则表达式的写法,在此利用正则表达式的方式来列举一下判断数字的方法. <? if($str) { if(eregi("^[0-9]+$",$str)) { $str=(int)$str; } else { echo "获取到的数据不是有效的数字类型,操作将停止!"; exit(); } } else { echo &qu

  • php二维数组按某个键值排序的实例讲解

    排序前 Array ( [0] => Array ( [name] => 龙 [age] => 2017-02-28 ) [1] => Array ( [name] => 龙2 [age] => 2017-03-14 ) [2] => Array ( [name] => 小3 [age] => 2017-05-09 ) [3] => Array ( [name] => 龙4 [age] => 2017-02-03 ) [4] =>

  • PHP正则判断一个变量是否为正整数的方法

    方法1 判断正整数 $keyword = '10'; // 0 1.1 1 if(preg_match("/^[1-9][0-9]*$/",$keyword)){ echo "是正整数!"; exit(); } 方法2 判断正整数 if ((floor($jp_total) - $jp_total) !==0){ echo "不是正整数"; }else{ echo "是正整数"; } 方法3 判断整数 if(!is_numer

  • PHP实时统计中文字数和区别

    1.PHP 中如何正确统计中文字数?这个是困扰我很久的问题,PHP 中有很多函数可以计算字符串的长度,比如下面的例子,分别使用了 strlen,mb_strlen,mb_strwidth 这个三个函数去测试统计字符串的长度,看看把中文算成几个字节: echo strlen("你好ABC") . ""; # 输出 9 echo mb_strlen("你好ABC", 'UTF-8') . ""; # 输出 5 echo mb_st

随机推荐