<?php// Source: http://us2.php.net/manual/en/function.nl2br.php#68993// Modified by Stephen (http://stephen.calvarybucyrus.org) function nl2br($text){return preg_replace("/\\r\\n|\\n|\\r/", "<BR>", $text);} $a = "one\ntwo\r\nthree"; echo nl2br($a);?>