奇怪的問題php

$text=nl2br($text);

$text=str_replace("\n","<br/>",$text);

有些情況下第二種做法不能把會回車符轉換為<br/>

原文地址:https://www.cnblogs.com/lv_yantao/p/2228327.html