用的MAC 系統(tǒng)
1. 在JS內(nèi)將\n 替換成
var reg=new RegExp("\n","g");
content= content.replace(reg,"<br/>");
2. 存入數(shù)據(jù)庫后拿出, 用PHP將<br/>替換成\n
$search = "<br/>";
$replace = "\n";?
$content = str_replace($search,$replace,$content);
用的MAC 系統(tǒng)
1. 在JS內(nèi)將\n 替換成
var reg=new RegExp("\n","g");
content= content.replace(reg,"<br/>");
2. 存入數(shù)據(jù)庫后拿出, 用PHP將<br/>替換成\n
$search = "<br/>";
$replace = "\n";?
$content = str_replace($search,$replace,$content);