Get_html_translation_table
(PHP4 >= 4.0b4)
Get_html_translation_table---&http://www.aliyun.com/zixun/aggregation/37954.html ">nbsp; Returns the conversion table used by Htmlspecialchars () and Htmlentities ()
Syntax: string get_html_translation_table (int table)
Description:
Get_html_translation_table () will return the conversion table used internally by Htmlspecialchars () and Htmlentities (), which has two new definitions Html_ Datastore and Htmlspecialchars, which allows you to specify the form you want.
Example:
<?php
$trans = get_html_translation_table (html_entities);
$str = "Hallo & <Frau> & kr 鄝 er";
$encoded = Strtr ($str, $trans);
?>
Variable $encoded will include: "Hallo & < Frau> & Krämer "
Using Array_flip () can change the direction of transformation
Example:
<?php
$trans = Array_flip ($trans);
$original = Strtr ($str, $trans);
?>
$original content will be: "Hallo & <Frau> & kr 鄝 er"
Note: This function is a new function in PHP4.0
Reference: Htmlspecialchars () htmlentities () Strtr () Array_flip ()