I have this data in a database:
I am able to show plain text using this PHP function:
if(!function_exists("dropHtmlTags")) {
function dropHtmlTags($string) {
// remove html tags
$string = strip_tags($string, ' \r\n\t');
return $string;
}
}
but i want to keep the line breaks when displaying, how can i do this?
UPDATED CODE
if(!function_exists("dropHtmlTags")) {
function dropHtmlTags($string) {
// remove html tags
$string = strip_tags($string, ' \r\n\t');
return nl2br($string);
}
}