Use this:
echo nl2br($result[msg]);
As long as browsers doesn't treat \r\n as real new-lines - you need to "convert" them to 's with nl2br()
\r\n