Sort of:
public static string Nl2br(string str) { return Nl2br(str, true); } public static string Nl2br(string str, bool isXHTML) { string brTag = "<br>"; if (isXHTML) { brTag = "<br />"; } return str.Replace("\r\n", brTag + "\r\n"); }
Here's the function signature from a PHP document:
string nl2br (string $ string [, bool $ is_xhtml = true])
The PHP function also adds a new line after the break tag.
source share