$text=str_replace(array("\r\n", "\r", "\n"), "[br/]", $text);
Well, the above function takes into concern that:
On Windows the enter key press means "\r\n",
On Linux/UNIX/BSD and other UNIX derivatives the enter key press means "\n"
and on a Mac, it is "\r\".
Probably the built in nl2br() in PHP is implemented differently, so the glitch appeared.