note 103939 deleted from function.htmlspecialchars by cmb

From: Date: Sun, 27 Oct 2019 09:20:44 +0000
Subject: note 103939 deleted from function.htmlspecialchars by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-212859@lists.php.net to get a copy of this message
Note Submitter: info at 8th dot at ---- English: I'd found THE Final Solution! it finds and replaces all unknown letters! (like Ä, Ö, Ü, ß, and much much more) it turn em in a HTML AND XML compatible format parameter: $text: a String with unsuported letters in it return: a String where all unsupported(XML und HTML) letters are changed into the Unicode value (for example &#196;) Deutsch/German: Ich hab die perfekte Lösung gefunden! Es findet und tauscht alle unbekannten Buchstaben! (wie Ä, Ö, Ü, ß, und viel viel mehr) es tauscht sie in ein HTML und XML kompatibles Format parameter: $text: ein String mit nichtunterstüzten Buchstaben return: ein String wo alle von XML und HTML ununterstützten Buchstaben ins Unicode-Format getauscht sind (z.B. &#196;) FUNCTION: <?php function umlaute($text){ $returnvalue=""; for($i=0;$i<strlen($text);$i++){ $teil=hexdec(rawurlencode(substr($text, $i, 1))); if($teil<32||$teil>1114111){ $returnvalue.=substr($text, $i, 1); }else{ $returnvalue.="&#".$teil.";"; } } return $returnvalue; } ?>

« previous php.notes (#212859) next »