Darf ich Zeilenumbrüche und anderes so simpel austauschen, oder kann das zu Problemen führen?
function text_db($text){
$text = trim($text);
$text = htmlentities($text);
$text = str_replace("\n", "<br>", $text);
$text = str_replace('(titel)', '<div class="titel">', $text);
$text = str_replace('(code)', '<div class="code">', $text);
$text = str_replace('(hinweis)', '<div class="hinweis">', $text);
$text = str_replace('(table)', '<table width="100%">', $text);
$text = str_replace('(tr)', '<tr>', $text);
$text = str_replace('(td)', '<td>', $text);
$text = str_replace('(/titel)', '</div>', $text);
$text = str_replace('(/code)', '</div>', $text);
$text = str_replace('(/hinweis)', '</div>', $text);
$text = str_replace('(/table)', '</table>', $text);
$text = str_replace('(/tr)', '</tr>', $text);
$text = str_replace('(/td)', '</td>', $text);
return $text;
}
function text_edit($text){
$text = str_replace("\n", "<br>", $text);
$text = str_replace('<div class="titel">', '(titel)', $text);
$text = str_replace('<div class="code">','(code)' , $text);
$text = str_replace('<div class="hinweis">','(hinweis)' , $text);
$text = str_replace('<table width="100%">','(table)' , $text);
$text = str_replace('<tr>', '(tr)', $text);
$text = str_replace('<td>', '(td)', $text);
$text = str_replace('</div>', '(/titel)', $text);
$text = str_replace('</div>', '(/code)', $text);
$text = str_replace('</div>', '(/hinweis)', $text);
$text = str_replace('</table>', '(/table)', $text);
$text = str_replace('</tr>', '(/tr)', $text);
$text = str_replace('</td>', '(/td)', $text);
return $text;
}