get_html_translation_table

(PHP 4 , PHP 5)

get_html_translation_table --  бНГБПЮЫЮЕР РЮАКХЖС ОПЕНАПЮГНБЮМХИ, ХЯОНКЭГСЕЛСЧ ТСМЙЖХЪЛХ htmlspecialchars() Х htmlentities()

нОХЯЮМХЕ

array 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. нОХЯЮМХЕ quote_style ЯЛ. Б НОХЯЮМХХ ТСМЙЖХХ htmlspecialchars().

Пример 1. оПХЛЕП РЮАКХЖШ ОПЕНАПЮГНБЮМХИ

<?php
$trans
= get_html_translation_table(HTML_ENTITIES);
$str = "Hallo & <Frau> & KrДmer";
$encoded = strtr($str, $trans);
?>
оЕПЕЛЕММЮЪ $encoded АСДЕР ЯНДЕПФЮРЭ: "Hallo &amp; &lt;Frau&gt; &amp; Kr&auml;mer".

дПСЦХЛ ХМРЕПЕЯМШЛ ОПХЛЕМЕМХЕЛ ЩРНИ ТСМЙЖХХ ЪБКЪЕРЯЪ ХГЛЕМЕМХМ МЮОПЮБКЕМХЪ ОПЕНАПЮГНБЮМХЪ Я ОНЛНЫЭЧ ТСМЙЖХХ array_flip().

<?php
$trans
= array_flip($trans);
$original = strtr($encoded, $trans);
?>

оЕПЕЛЕММЮЪ $original АСДЕР ЯНДЕПФЮРЭ: "Hallo & <Frau> & KrДmer".

яЛЧ РЮЙФЕ НОХЯЮМХЕ ТСМЙЖХИ htmlspecialchars(), htmlentities(), strtr() Х array_flip().


HIVE: All information for read only. Please respect copyright!
Hosted by hive йца: йХЕБЯЙЮЪ ЦНПНДЯЙЮЪ АХАКХНРЕЙЮ