Funktion clearHtmlTags zur Bereinigung von ul, li und br-Tags

Anwendung auf Lehrinhalte in Zertifikat
This commit is contained in:
Martin Tatzber
2014-02-24 08:58:00 +00:00
parent b7ad289788
commit 0d5a89a96b
2 changed files with 16 additions and 0 deletions
+15
View File
@@ -882,4 +882,19 @@ function decryptData($value,$key)
$decrypttext = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $crypttext, MCRYPT_MODE_ECB, $iv);
return trim($decrypttext);
}
function clearHtmlTags($text)
{
$text=mb_str_replace('<br>','\n',$text);
$text=mb_str_replace('<br/>','\n',$text);
$text=mb_str_replace('<br />','\n',$text);
$text=mb_str_replace('<ul>\n','',$text);
$text=mb_str_replace('<ul>','',$text);
$text=mb_str_replace('</ul>','',$text);
$text=mb_str_replace('<li>','\n - ',$text);
$text=mb_str_replace('</li>','',$text);
return $text;
}
?>