note 52186 deleted from function.htmlspecialchars by cmb
| From: | cmb@php.net | Date: | Sun, 27 Oct 2019 09:16:52 +0000 |
| Subject: | note 52186 deleted from function.htmlspecialchars by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-212848@lists.php.net to get a copy of this message | ||
Note Submitter: took
----
The Algo from donwilson at gmail dot com to reverse the action of htmlspecialchars(), edited for
germany:
function unhtmlspecialchars( $string )
{
$string = str_replace ( '&', '&', $string );
$string = str_replace ( ''', '\'', $string );
$string = str_replace ( '"', '"', $string );
$string = str_replace ( '<', '<', $string );
$string = str_replace ( '>', '>', $string );
$string = str_replace ( 'ü', 'ü', $string );
$string = str_replace ( 'Ü', 'Ü', $string );
$string = str_replace ( 'ä', 'ä', $string );
$string = str_replace ( 'Ä', 'Ä', $string );
$string = str_replace ( 'ö', 'ö', $string );
$string = str_replace ( 'Ö', 'Ö', $string );
return $string;
}