PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Did any of you try to replace new line?
I know for nl2br, it just adds <br /> after \n.
I've try with str_replace("\n",'<br>',$str) but it's same as nl2br()
you are right...
as far as i know,\r\n is for windows? \n for *nix and \r is for MAC?
Anyway i use this
str_replace("\r\n","<br />",$str);
str_replace("\n","<br>",$str);
str_replace("\r","<br />",$str);
which works fine on both my windoze server and my host's unix system. But 1 or 2 people have had problems with my scripts on systems where for some reason \r\n was seen as 2 newlines.