note 52186 added to function.htmlspecialchars

From: Date: Sat, 23 Apr 2005 16:14:53 +0000
Subject: note 52186 added to function.htmlspecialchars
Groups: php.notes 
Request: Send a blank email to php-notes+get-88451@lists.php.net to get a copy of this message
The Algo from donwilson at gmail dot com to reverse the action of htmlspecialchars(), edited for germany: function unhtmlspecialchars( $string ) { $string = str_replace ( '&amp;', '&', $string ); $string = str_replace ( '&#039;', '\'', $string ); $string = str_replace ( '&quot;', '"', $string ); $string = str_replace ( '&lt;', '<', $string ); $string = str_replace ( '&gt;', '>', $string ); $string = str_replace ( '&uuml;', 'ü', $string ); $string = str_replace ( '&Uuml;', 'Ü', $string ); $string = str_replace ( '&auml;', 'ä', $string ); $string = str_replace ( '&Auml;', 'Ä', $string ); $string = str_replace ( '&ouml;', 'ö', $string ); $string = str_replace ( '&Ouml;', 'Ö', $string ); return $string; } ---- Manual Page -- http://www.php.net/manual/en/function.htmlspecialchars.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+52186 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52186&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52186&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52186&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52186&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52186&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+52186&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#88451) next »