• PHP Video Tutorials

PHP - Function Get Html Translation Table



Syntax

array get_html_translation_table ([ int $table = HTML_SPECIALCHARS [, 
   int $flags = ENT_COMPAT | ENT_HTML401 [, string $encoding = "UTF-8" ]]] )

Definition and Usage

It returns the translation table used by the htmlentities() and htmlspecialchars() functions.

Return Values

It returns the translation table as an array with the original characters as keys and entities as values.

Parameters

Sr.No Parameters & Description
1

table

It contains the information about which table to return Either HTML_ENTITIES or HTML_SPECIALCHARS

2

flags

It contains the flags information

Example

Try out the following example

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

This will produce following result −

Array
(
   ["] => "
   [&] => &
   [<] => <
   [>] => >
)
php_function_reference.htm
Advertisements