That's odd. Your second example ('what you want') is exactly what I get when a try a simple example.
echo nl2br("this\nis\na\ntest");
gives
This<br>
is<br>
a<br>
test
What version of php is this, and on what platform?