<?php # переносы строк function br($msg, $br = '<br />') { return preg_replace("#((<br( ?/?)>)|n|r)+#i", $br, $msg); }