Sonderzeichen ersetzen
Bitte Text in das Feld eintragen, Umlaute und Sonderzeichen werden durch HTML-Entities ersetzt.
";
function umwandeln($text, $quot)
{
$replace = array (
"ä" => "ä",
"ö" => "ö",
"ü" => "ü",
"Ä" => "Ä",
"Ö" => "Ö",
"Ü" => "Ü",
"ß" => "ß",
"§" => "§",
"©" => "©",
"®" => "®",
"°" => "°"
);
$text = nl2br($text);
$text = strtr($text, $replace);
switch ($quot)
{
case 2:
$text = strtr($text, array('"' => "\\\""));
break;
case 3:
$text = strtr($text, array('"' => "'"));
break;
case 4:
$text = strtr($text, array('"' => """));
break;
case 5:
$text = strtr($text, array("\\\"" => '"'));
break;
case 6:
$text = strtr($text, array("'" => "\""));
break;
case 7:
$text = strtr($text, array(""" => '"'));
break;
}
// keine HTML-Tags erlaubt, außer p und br
//$text = strip_tags($text, '
');
// HTML-Tags maskieren
//$text = htmlspecialchars($text, ENT_QUOTES);
return $text;
}
function keephtml($text)
{
$replace = array (
"<" => "<",
">" => ">",
'"' => """
);
return strtr($text, $replace);
}
?>