note 37608 deleted from function.html-entity-decode by didou
| From: | didou@php.net | Date: | Fri, 09 Jan 2004 15:48:29 +0000 |
| Subject: | note 37608 deleted from function.html-entity-decode by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-63205@lists.php.net to get a copy of this message | ||
Note Submitter: mike-php@emerge2.com
----
If you need to roll your own version of this function, try this:
function html_entity_decode( $given_html, $quote_style = ENT_QUOTES ) {
$trans_table = get_html_translation_table( HTML_SPECIALCHARS, $quote_style );
if( $trans_table["'"] != ''' ) { # some versions of PHP match
single quotes to '
$trans_table["'"] = ''';
}
return ( strtr( $given_html, array_flip( $trans_table ) ) );
}