php - reverse htmlspecialchars -
this may seem simple problem couldn't find in archives.
how 1 reverse effects of htmlspecialchars?
i tried this:
$trans_tbl = get_html_translation_table (html_entities); $trans_tbl = array_flip ($trans_tbl); $html = strtr ($html, $trans_tbl);
but didn't work. there simple way this?
use htmlspecialchars_decode()
<?php $str = "<p>this -> "</p>\n"; echo htmlspecialchars_decode($str); // note here quotes aren't converted echo htmlspecialchars_decode($str, ent_noquotes); ?>
reference - php official doc
Comments
Post a Comment