get_html_translation_table() function in PHP || PHP get html translation table function
×


get_html_translation_table() function in php

1968

PHP get_html_translation_table() function is used to returns a translation table. This table is used by htmlspecialchars() and htmlentities() PHP functions. It is an inbuilt function of PHP.

The return type of this function is array means it returns the translation table as an array.

Syntax:

get_html_translation_table(table,flags,characters);

here,

1. The table specifies which type of translation table is returned. It is optional. It has two possible values:

  • HTML_SPECIALCHARS
  • HTML_ENTITIES

2. Flags used to specify the quotes and document types used by the table. It is also an optional parameter. The possible values for this are:

For quotes:

  • ENT_COMPAT
  • ENT_QUOTES
  • ENT_NOQUOTES

For document type:

  • ENT_HTML401
  • ENT_HTML5
  • ENT_XML1
  • ENT_XHTML

3. Characters specify which type of character set is to be used. It is also optional. Possible values are:

  • UTF-8
  • ISO-8859-1
  • ISO-8859-15
  • cp866
  • cp1251
  • cp1252
  • KOI8-R
  • BIG5
  • GB2312
  • BIG5-HKSCS
  • Shift_JIS
  • EUC-JP
  • MacRoman

Example:

<?php
$table=get_html_translation_table(HTML_SPECIALCHARS);
echo "<pre>";
print_r($table);
?>

Output:




Best WordPress Hosting


Share:


Discount Coupons

Get a .COM for just $6.98

Secure Domain for a Mini Price



Leave a Reply


Comments
    Waiting for your comments