$content = $_POST['content'];

echo str_replace("\n", "<br />", $content);

写入数据库效果

wKiom1S2D8yj7tcLAAAf5f9heu0004.jpg