PDA

View Full Version : html_entity_decode for PHP Help



Emancipator
10-30-2004, 11:43 AM
I was using php4 but am now using 4.2 and can not use html_entity_decode so this line of code, no loner works


<? echo html_entity_decode(html_entity_decode($r['Content']['_value_'])); ?>

any other php programmers in our midst with a clean fix for doing this in php4?

Merci.

tomek
10-30-2004, 12:37 PM
a look at the documentation would have helped you: www.php.net/html_entity_decode



function unhtmlentities($string)
{
$trans_tbl = get_html_translation_table(HTML_ENTITIES);
$trans_tbl = array_flip($trans_tbl);
return strtr($string, $trans_tbl);
}

Emancipator
10-30-2004, 01:01 PM
well shoot me.