note 103939 added to function.htmlspecialchars
| From: | info at 8th dot at | Date: | Thu, 12 May 2011 18:28:57 +0000 |
| Subject: | note 103939 added to function.htmlspecialchars | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-179661@lists.php.net to get a copy of this message | ||
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 Ä)
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. Ä)
FUNCTION:
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;
}
----
Server IP: 69.147.83.197
Probable Submitter: 178.191.184.255
----
Manual Page -- http://www.php.net/manual/en/function.htmlspecialchars.php
Edit -- https://master.php.net/note/edit/103939
Del: integrated -- https://master.php.net/note/delete/103939/integrated
Del: useless -- https://master.php.net/note/delete/103939/useless
Del: bad code -- https://master.php.net/note/delete/103939/bad+code
Del: spam -- https://master.php.net/note/delete/103939/spam
Del: non-english -- https://master.php.net/note/delete/103939/non-english
Del: in docs -- https://master.php.net/note/delete/103939/in+docs
Del: other reasons-- https://master.php.net/note/delete/103939
Reject -- https://master.php.net/note/reject/103939
Search -- https://master.php.net/manage/user-notes.php