I am having some problems replacing strings using PHP. I have a MySQL table from where I fetch data. For new lines, I use \n in the MySQL table and when outputting this data, I would like to convert \n to <br />. This is what I use:
CODE
function FormatStuff($stuff) {
$stuff = strtr($stuff, "\n", "<br />");
return $stuff;
}
$stuff = strtr($stuff, "\n", "<br />");
return $stuff;
}
The function is called using:
CODE
FormatStuff($row[4])
The above doesn't seem to work. The data which the function throws out is the same as the data passed. Do I have to escape some characters or someting?
Regards,
Sebastian
