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 -&gt; &quot;</p>\n";  echo htmlspecialchars_decode($str);  // note here quotes aren't converted echo htmlspecialchars_decode($str, ent_noquotes); ?> 

reference - php official doc


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -