Warning: include(../lntop.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/get-html-translation-table.html on line 19

Warning: include() [function.include]: Failed opening '../lntop.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/get-html-translation-table.html on line 19

Warning: include(../levoe_menu.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/get-html-translation-table.html on line 46

Warning: include() [function.include]: Failed opening '../levoe_menu.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/get-html-translation-table.html on line 46



Учебник РНР
Назад Вперёд

get_html_translation_table

(PHP 4)

get_html_translation_table - возвращает таблицу трансляции, используемую функциями htmlspecialchars() и htmlentities().

Описание

string get_html_translation_table (int table [, int quote_style])

get_html_translation_table() возвратит таблицу трансляции, используемую внутренне для функций htmlspecialchars() и htmlentities(). Имеются два новых определения (HTML_ENTITIES, HTML_SPECIALCHARS), позволяющие специфицировать необходимую таблицу. И, как и в функциях htmlspecialchars() и htmlentities(), вы можете по выбору специфицировать quote_style, с которым вы работаете. По умолчанию установлен режим ENT_COMPAT. См. описание режимов в htmlspecialchars().
Пример 1. Таблица Трансляции
$trans = get_html_translation_table(HTML_ENTITIES);
$str = "Hallo & <Frau> & Krimer";
$encoded = strtr($str, $trans);

Переменная $encoded теперь содержит : "Hallo &amp; &lt;Frau&gt; &amp; Kraumer".

Хорошо использовать array_flip() для изменения направления трансляции.
$trans = array_flip($trans);
$original = strtr($encoded, $trans);

Содержимым $original будет: "Hallo & <Frau> & Kraumer".

См. также htmlspecialchars(), htmlentities(), strtr() и array_flip().


Назад Оглавление Вперёд
explode Вверхget_meta_tags


Warning: include(../pravoe_menu.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/get-html-translation-table.html on line 155

Warning: include() [function.include]: Failed opening '../pravoe_menu.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/get-html-translation-table.html on line 155

Rambler's Top100
© 2009 Тест скорости интернета |  Boont.Ru

Warning: include(../lnbottom.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/get-html-translation-table.html on line 281

Warning: include() [function.include]: Failed opening '../lnbottom.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/get-html-translation-table.html on line 281